• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

jsp:forward

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi! ranchers,

can anyone explain about this tag...
is it a valid tag?

<jsp:forward page="%=request.getParameter('redirectto')%" />



Thank you in advance
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe the foll. is correct?

<jsp:forward page="<%=request.getParameter('redirectto')%>"/>

http://java.sun.com/products/jsp/tags/11/syntaxref11.fm9.html
 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it's a valid tag...
but the container will look for the "%=request.getParameter('redirectto')%" resource...
correct me if i wrong..
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The tag present in the first post is valid because it is a JSP Document(XML) tag. When using JSP Document following is valid:


In JSP Document runtime attribute values are passed as above.

Is it clear now ?
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bassam is right. The above syntax is JSP Document and not JSP page.
The clue is the missing '<' and '>'. In JSP Documents, the request time attributes (expressions) do not contain '<' and '>'.

But I couldn't get the above tag to work in Tomcat 5.0.30

<jsp:forward page="%=request.getParameter('redirectto')%" />

I had to change it to...

<jsp:forward page='%=request.getParameter("redirectto")%' />

as I was getting a compile time error.
C:\jakarta-tomcat-5.0.30\work\Catalina\localhost\vish\org\apache\jsp\xmlCaller_jsp.java:54: unclosed character literal
_jspx_page_context.forward(request.getParameter('redirectto'));


I had to swap the single quotes with the double quotes to get it working. So I am inclined to believe that the above code in question might still be invalid.

What do you say, Bassam?
 
janne s
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! ranchers

Thanks for your replies
 
It's just a flesh wound! Or a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic