• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

How to avoid using formbean and redirect to another JSP ?

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In one of my JSP pages, I need to press a button and move to another JSP. There is no business logic to put in an action, nor any request parameters to be captured by the form bean. I know that I can forward using html:link and ForwardAction class, but I want to do this from a button press and not from a link. How do I do that ?

Thanks
Devi
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One way to do it would be like this:

<html:button property="myButton" value="click me" onklick="location.replace('myOtherPage.jsp')" />
 
Sreedevi Vinod
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, but I didn't want to link directly from one JSP to another, since thats not a good practice. Every redirection should happen through the controller. So finally I used a blank form bean along with ForwardAction and posted to it using html:form. That worked, but now I have another problem.
I have a flash movie on the JSP page to which I'm redirecting. This flash movie is not playing when I redirect like this through the ActionServlet.
The page keeps loading as shown by the progressbar on the browser, but never completes rendering. The title and text at the top does appear. Why could this be happening ? However, it loads the page and plays the flash movie immediately when I provide a direct link to the JSP page itself.
Please advice.

Thanks
Devi
 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use..



Then using Javascript (write within the function which will be called by click of the button) to redirect to the url
 
Liar, liar, pants on fire! refreshing plug:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic