954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

<!% public void method()%> and request.getParameter

Hi All!


I'm trying to call a method defined in a jsp that is in my webcontent web application.

I placed

<%@include file="method.jsp"%>


in the jsp from where I want to call the method.

I get an exception saying:

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 247 in the jsp file: /replaceBlob.jsp
The method replace(String, char, String, String) is undefined for the type replaceBlob_jsp
softDeveloper
Junior Poster in Training
67 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

And the request.getParameter() stops working

softDeveloper
Junior Poster in Training
67 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

why would you even want to have complete methods in a jsp file?
to have a single line of java code in your jsp, even though it's not very good practice, now that I could still understand, but an entire method?

stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
 

a recursive method in order to build a replace statement for mysql. How can you do recursion in a jsp file and at the same time get parameters from request.getparameter()? I get errors

softDeveloper
Junior Poster in Training
67 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

you should avoid having java code in your jsp at all.
I think you may want to switch into using servlets and jsp, instead of just jsp.

stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: