• 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

fow to forward to an action from jsp ?

 
Ranch Hand
Posts: 31
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to forward to an action/jsp from jsp page like this.



How can i achieve this ?

Please help.
Thanks in advance.
 
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why? That's not an appropriate action for a JSP. Why are not such decisions being made in the action?
 
Bibhudutta Pradhan
Ranch Hand
Posts: 31
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Because I want to display data(from database) in the same page.
 
Bear Bibeault
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That makes no sense. If you forward, you're not on the "same page" any longer.
 
Bibhudutta Pradhan
Ranch Hand
Posts: 31
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok. sir. Thanks for your reply.

Please help me how would i display data from a database in the same page on a click of a submit button(In struts2)

please help.

 
Bear Bibeault
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't use struts, so I can't help you with specifics. I just know that forward was not the right approach.
 
Bibhudutta Pradhan
Ranch Hand
Posts: 31
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am also new to struts.

I used to display data from Database in the same page(in servlet/jsp) on click of a submit button like this :

info.jsp
............................................


1)The first time the info.jsp page is called info is null.Hence dont show info.
2)When the button is clicked servlet is called. the servlet gets the data from the database and then forward the data to the info.jsp page, setting info as attribute.
Now in the info.jsp info is not null. displaying the result.

I want to know is this the right approach to display data in the same page?
And now i want to do it in the same process in struts.
 
Bear Bibeault
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like what you need is Ajax.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bibhudutta Pradhan wrote:I want to forward to an action/jsp from jsp page like this.



How can i achieve this ?

Please help.
Thanks in advance.




You can try location.href=url on click of submit button
through javascript. In the "url" part you can mention the struts mapping url.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic