Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSP
Search Coderanch
Advance search
Google search
Register / Login
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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
JSP
URLrewriting
A Kumar
Ranch Hand
Posts: 980
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
For servlets...we have encodeURL for url rewriting...in case cookies are disbled at client side...
But how to do the same if only
jsp
's are involved...
Regards
Darren Edwards
Ranch Hand
Posts: 69
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Assuming you have JSTL available within your JSP
<a href="<c:url value="/runAction.do" />">Run Action</a>
Be aware that it will not encode GET parameters in the same way encodeURL does - you have to do the following
<c:url value="/runAction.do"> <c:param name="param1" value="value1" /> </c:url>
A Kumar
Ranch Hand
Posts: 980
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Darren,
Thanks for the response....
I wanted to know about the pre-JSTL days..How they used to do it?
Regards
ramprasad madathil
Ranch Hand
Posts: 489
I like...
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I wanted to know about the pre-JSTL days..How they used to do it?
You could very easily write a custom tag. Or else write in a scriptlet, the exact code that you would, if it were a
Servlet
(though it would undoubtedly clutter your jsp code)
ram.
A Kumar
Ranch Hand
Posts: 980
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
So the solution...was ....
writing the same code that would be there in servlet ...as in a scriptlet section of a jsp...
Is it so???
Stefan Evans
Bartender
Posts: 1845
10
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You could do it with scriptlet expression
<a href="<%= response.encodeURL("/user/save.jsp") %>"> Save </a>
No it doesn't look nice. And people often forgot to do it.
Hence custom tags which take care of it for you ;-)
A Kumar
Ranch Hand
Posts: 980
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks Stefan!!!
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Session management with cookies disabled client.
When to use URLRewriting ?
listener question
URL Rewriting
encodeURL vs encodeRedirectURL
More...