Solved

Struts-JSP execute action class without manual submission

Posted on 2004-03-30
4
685 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
EJB MDB example 4 83
nested if has else if 13 94
JSP How to use numberFormat to display a negative number without parenthesis? 1 164
web application structure 18 77
This tutorial shows how to create a greeting card by combining two image layers and a text layer on a PC using a free image editing app.
For months I had no idea how to 'discover' the IP address of the other end of a link (without asking someone who knows), and it drove me batty. Think about it. You can't use Cisco Discovery Protocol (CDP) because it's not implemented on the ASAs.…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

773 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