Results 1 to 3 of 3
Thread: JSP help
- 12-30-2010, 02:36 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 4
- Rep Power
- 0
JSP help
Can any one help me to solve this please
<%@page import="myutil.*" %>
<%String input = request.getParameter("s1");%>
<%String occur = request.getParameter("s2");%>
<%int output=B.repeatCount("input","occur");%>
<%=input%>
In the above code , i want to pass the variable of Strings input and occur to the method repeatCount.. can any one suggest how to do it
for example if i get input = abc and occur =qwe
i want to get in the generated servlet as follows:
int output=B.repeatCount("abc","qwe");
- 12-31-2010, 02:35 AM #2
uh wouldn't it be just this, without the quotes o the name of variable. ?
I mean, you can't have a request parameter read from the URL, after a JSP has been compiled into a Java class, influence the generation of the Java class, so that the parameter entered becomes a literal string constant in the generated java class.Java Code:<%@page import="myutil.*" %> <%String input = request.getParameter("s1");%> <%String occur = request.getParameter("s2");%> <%int output=B.repeatCount(input,occur);%> <%=input%>
perhaps it might be possible to have something that would write out a jsp page inside your application folder, and then if the user invoked that generated jsp page, it would have the literal string value, i guess.
- 12-31-2010, 04:40 AM #3
Member
- Join Date
- Dec 2010
- Posts
- 4
- Rep Power
- 0


LinkBack URL
About LinkBacks


Bookmarks