Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Getting request parameter in jsp DOCUMENT

  Asked By: Arnold    Date: Jul 08    Category: Java    Views: 969
  

i want to get a request parameter in a jsp document (xml style jsp page) but it does not work. i wrote the below statement:

<img onclick="window.alert(<%=request.getParameter(\"name\")%>);"/>

after execution, the above code produces the below statement in html page:
<img onclick='window.alert(<%=request.getParameter("name")%>);'/>

the problem is that the expression does not execute and is put in the result page without execution.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Damon Jones     Answered On: Jul 08

Try removing ";" at the end of your scriptlet. It is unnecessary.
I hope it will solve the problem.

 
Didn't find what you were looking for? Find more on Getting request parameter in jsp DOCUMENT Or get search suggestion and latest updates.




Tagged: