aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes jsp:param Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "jsp:param" Watch "jsp:param" New topic
Author

jsp:param

shanthisri mocherla
Ranch Hand

Joined: Sep 05, 2005
Posts: 119
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

Joined: Nov 24, 2005
Posts: 14687
    
  16

You should remove <br> inside the forward tag.


[My Blog]
All roads lead to JavaRanch
MInu
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
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


God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
P Chittaranjan
Ranch Hand

Joined: Feb 09, 2006
Posts: 47
Hi did you put the param tag correctly like this
<jsp aram name="X" value="8" />


Thanks,<br />Chittaranjan<br />SCJP 5.0,SCWCD1.4,SCBCD 5
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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

Joined: Oct 09, 2003
Posts: 517
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

Joined: Feb 09, 2006
Posts: 47
<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

Joined: Feb 09, 2006
Posts: 47
":"+"p" is getting converted to somthing else here after posting.

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

thanks
shanthisri mocherla
Ranch Hand

Joined: Sep 05, 2005
Posts: 119
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

Joined: Oct 26, 2004
Posts: 56
Hi Shanthi,
Can u provide me the link where you are getting these questions ?

Thanks
Muthu
shanthisri mocherla
Ranch Hand

Joined: Sep 05, 2005
Posts: 119
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

Joined: Dec 04, 2004
Posts: 950
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.


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
P Chittaranjan
Ranch Hand

Joined: Feb 09, 2006
Posts: 47
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp:param
 
Similar Threads
problem in jsp:include tag
forward page and parameter
where can we use jsp:param
JSP forward tag
Problem with nested:link href