Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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: 67619
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: 67619
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: 67619
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: 67619
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic