Solved

Struts-JSP execute action class without manual submission

Posted on 2004-03-30
4
683 Views
Last Modified: 2007-12-19
In a STRUTS-JSP , how do we submit an action without submit step/without user interaction. When a JSP is run , would like the *.do (action class) to be executed automatically. I gues similar to onload of JSP. But I am not sure which method needs to be called and what attributes need to be passed. Exlplanation of the flow and an example will be of great help

I understand the workflow of defining an ActionForm, associate it with a submitting JSP page, passing it to an Action and forwarding the results to a view JSP page; what I'm not seeing is how to generate a dynamic JSP page without the submit step?...

Thanks
0
Comment
Question by:ramanirp
4 Comments
 
LVL 6

Accepted Solution

by:
jarasa earned 63 total points
ID: 10722048
Hi, not sure if this is what you want.

You can do that with Javacript, just place a script right before </BODY> like this:

<BODY>
.......
<FORM name="yourForm" action="yourNextAction">
<Input type="Hidden" name="Field1" value=<%= request.getParameter("FIELD1") %>
</FORM>
.......
<Scrtipt>
top.document.yourForm.submit();
</Script>
</BODY>

This will automatically redirect to yourNextAction.

Javier
0
 
LVL 14

Assisted Solution

by:kennethxu
kennethxu earned 62 total points
ID: 10725708
>> how to generate a dynamic JSP page without the submit step?
simple call the url that mapped to the action class.e.g
http://www.yoursite.com/youapp/youaction.do
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
simple jsp servlet and webservice web example 5 110
Fisheye tool 2 101
own marker interface 1 44
Market Place not working in Eclipse Luna 2 84
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now