• 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

jsp's hitting the ground running

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you asking for general JSP help or just this specific item?
 
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPIntro.html
 
Chris Mc
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
https://coderanch.com/t/279846/JSP/java/response-redirect-jsp-forward
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to our JSP forum...
 
This is my favorite tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic