• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:param

 
shanthisri mocherla
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm getting this error
while doing the exercise on jsp:forward std action using jsp aram eventhough I've written the correct code.

Can anyone please help.
The error is :
org.apache.jasper.JasperException: /test.jsp(19,32) Expecting "jsp aram" standard action with "name" and "value" attributes

Can anyone please explain me this.
Actually this code worked once before.
Thank you very much for your help in advance
Shanthi
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should remove <br> inside the forward tag.
 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hav removed <br> and tried the code.
But still i got the same error.

org.apache.jasper.JasperException: /A.jsp(5,1) Expected "param" tag with "name" and "value" attributes
 
P Chittaranjan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi did you put the param tag correctly like this
<jsp aram name="X" value="8" />
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by minu su:
I hav removed <br> and tried the code.
But still i got the same error.


Did you save your file ?

You should have something like :

<jsp:forward page="include.jsp">
<jsp aram name="X" value="6" />
</jsp:forward>
 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
m attaching my code

A.jsp
-----

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<body>
<jsp:forward page="include.jsp">
<jsp param name="X" value="6" />
</jsp:forward>

</body>
</html>


include.jsp
-----------

<%@ page isELIgnored="false"%>
<html>
<body>
${param.X}
</body>
</html>


anything wrong?
 
P Chittaranjan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<jsp param name="X" value="6" />

replace with
<jsp aram name="X" value="6" />

"jsp aram"--> should not have any space at the both side of ":".
 
P Chittaranjan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
":"+"p" is getting converted to somthing else here after posting.

please note <jsp aram is
"<jsp"+":"+"param"

thanks
 
shanthisri mocherla
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chittaranjan ,Minu and Satou I 've removed <br> from the code then it worked.
I've one more question.Do we come back to the forwarding JSP after <jsp:forward> standard action.

forward.jsp;



include.jsp
:


I'm expecting the ouput as
We are in include.jsp
6 7 8 7 8

I'm, passing X=7&Y=8 as the request parameters in the query string.
I know that the EL statements before jsp:forward action do not excute .But .I'm thinking that focus would come back to forward.jsp.
and print ${param.X}and ${param.Y} as 7 and 8.

Thanks in advance
shanthi

[ February 17, 2006: Message edited by: shanthisri mocherla ]
[ February 17, 2006: Message edited by: shanthisri mocherla ]
 
muthu kumaran
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shanthi,
Can u provide me the link where you are getting these questions ?

Thanks
Muthu
 
shanthisri mocherla
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi muthu,
I'm doing all on my own.I'm trying all the concepts on my own.that's it.
Dont' have any links.
thanks
shanthi
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Your o/p should be 6,7 and 8.
As you are using forword to include.jsp, the output of EL prior to <jsp:forward> will flushed so not displayed on output. The Two EL statements after the forword statement will not show any output , as the output stream is considered closed.
 
P Chittaranjan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi shanthisri,


Narendra is right. In case of <jsp:forward> control can not come back to the forwarding page. So statements after <jsp:forward> will never get executed.
If you want such type of output, can use <jsp:include>.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic