Solved

Struts-JSP execute action class without manual submission

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
ConnectWise and their customers need to ensure critical alerts automatically reach the right person at the right time. MSP superheros efficiently respond to these alerts key is providing automatic, intelligent alerting that generates a complete audi…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 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