• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

forwarding to a servlet instead of a jsp

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

I want to forward to a servlet instead of a jsp from my action class. In my action class i retrieve the pdf from database as byte[]and then i want to forward to a servlet which displays this pdf. I dont want to use ForwardAction because i dont want the database code in the servlet. How can i forward to a servlet instead of a jsp from my action class? What are the changes i need to make?
[ February 22, 2006: Message edited by: dnyan ginde ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To forward to a Servlet, just create a local forward that specifies the URL of your servlet and then return that ActionForward from the execute() method in your Action class.

example:
web.xml


struts-config.xml


execute() method in MyAction class:

return mapping.findForward("success");
[ February 22, 2006: Message edited by: Merrill Higginson ]
 
dnyan ginde
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a ton Merrill
 
Dinner will be steamed monkey heads with a side of tiny ads.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic