aspose file tools*
The moose likes Beginning Java and the fly likes jsp's hitting the ground running Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "jsp Watch "jsp New topic
Author

jsp's hitting the ground running

Chris Mc
Greenhorn

Joined: Jun 21, 2005
Posts: 8
Hello all. I've done a little java work (with someone looking over my shoulder) in the distant past with no refresher work, so I am mostly starting from scratch.

I need to have a jsp that will be opened by a link with several parameters appended to it's url. I'm going to have to take 1 or more of these parameters and assign it a new value (which I was thinking I would store in a properties file?) then redirect to another application's search page, appending the new values to the new url. My page doesn't need to display anything, it's purpose is simply to change the text of one of the variables to match that needed by the search page.

Can anyone point me in the direction of a jsp tutorial or suggest some first steps to get me going? I have Eclipse 3.0.1 and will be hosting the page on WAS 5.0.2.9
Thanks,
Chris
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9052
    
  12
Are you asking for general JSP help or just this specific item?


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
Welcome to JavaRanch!

http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPIntro.html
Chris Mc
Greenhorn

Joined: Jun 21, 2005
Posts: 8
Originally posted by Marilyn de Queiroz:
Are you asking for general JSP help or just this specific item?


Little bit of both I guess. The link provided by Mr. Huey is a great intro to .jsp and I will be sure to find that usefull in the future.

Looking through other web applications out there I cobbled together a quick test with a web.xml pointing to my Redirector servlet.

In the servlet I've followed some examples out there and created doGet and doPost methods, and have a processRequest method that can get the parameters from the url, reset the ones that need it then create a string of the correct url.

I found the code below that seems to work well forwarding to a page within the domain, but doesn't seem to forward out of the domain. Is there something similiar that I can use to redirect to another webapp?

getServletContext().getRequestDispatcher(url).forward(request,
response);
[ June 23, 2005: Message edited by: Chris Mc ]
Chris Mc
Greenhorn

Joined: Jun 21, 2005
Posts: 8
Originally posted by Stephen Huey:
Welcome to JavaRanch!

http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPIntro.html


Thanks very much. There's alot of good info there.
Chris Mc
Greenhorn

Joined: Jun 21, 2005
Posts: 8
Originally posted by Chris Mc:

I found the code below that seems to work well forwarding to a page within the domain, but doesn't seem to forward out of the domain. Is there something similiar that I can use to redirect to another webapp?

getServletContext().getRequestDispatcher(url).forward(request,
response);


That's the problem isn't it. I don't want to forward I want to redirect. I'll look for something along those lines.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9052
    
  12
http://www.coderanch.com/t/279846/JSP/java/response-redirect-jsp-forward
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Moving to our JSP forum...


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
Consider Paul's rocket mass heater.
 
subject: jsp's hitting the ground running