File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes http GET links Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "http GET links" Watch "http GET links" New topic
Author

http GET links

Dushy Inguva
Ranch Hand

Joined: Jun 24, 2003
Posts: 264
For http GET links, a JSP can expect 2 params. While composing this link, an ugly syntax has to be followed. Example: UserSubmit.jsp?UserID=<dynamicallyGenerated>&UserAge=<SomeMoreDynamicStuff>
This kind of syntax is problematic if a '&' is missed or if the dynamic stuff has spaces.
The solution we are thinking of is a helper class
URLGetLink link = new URLGetLink("UserSubmit.jsp");
link.addParam("UserID",<dynamicallyGeneratedStuff> ;
link.print(stream);

And use this from a custom tag, so that there is no java in the JSP pages. Is there a simpler way of doing this ?


SJCP, SCBCD, SJCD, SCDJWS, SCEA (Part I)
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4725

I'd recommend saving those two values to session scope if you need them for each request. It will make things prettier for the user and have higher security for you.


A good workman is known by his tools.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: http GET links
 
Similar Threads
Design Question
how to load the same jsp page and set user id to 0 when checkbox is selected
Info: Memorizing Deployment Descriptor
with out authentication it is forwading to another page
2 jsp buttons