Kuba Królikowski wrote:
Laurie Harper napisał(a):
Jakub Królikowski wrote:
Hello!
I'm new in Struts.
I don't know how to write such code using Struts (version in html):
<html>
<head>
<title>Simple Forward</title>
</head>
<body>
You can rename the source html file and it allways will works!!!
<br>
<form name="test" method="get" onsubmit="javascript:
this.action=document.location">
type a text and type "Enter" : <input type="text" name="text">
</form>
</body>
</html>
You can put it into any .html file and named it as you want - it will
allways works.
I want to use Struts Action and Struts Form - I want to handle form
values in action servlet. I don't know how to forward in action to
input page, when I don't know its name? After that I need all form
parameters to be printed in url - like in my example which simply
uses GET submit method. How to do it with Struts Action?
I'm not sure I followed all that. To answer the question I can see:
- to forward to the input page in an action, use code like the following:
return mapping.getInputForward();
You define what the 'input page' is with the 'input' attribute of your
action mapping in struts-config.xml. By default, this will do a
server-side redirect, so the browser's location bar will keep whatever
URL it had to invoke your action.
L..
But the input page in struts-config.xml cannot be set dynamicaly. I don't
know the name of input page. It could be whatever, it will change. Any
idea?
There's no reliable way to find out what page you were on before the
current page, unfortunately. You have to track that somehow yourself.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]