Originally posted by Kim Kantola: Hi, I have been given the suggestion that using a pre-login is good architechture for my struts-config.xml action mapping. This is the code piece I was given as an example:
The question I have is, I do not under stand what the parameter=".login" refers to, and I also don't understand how to link this up to my acutal login action and page.
Any help very appreciated, I am new to struts.
parameter indicates the resource you want the ForwardAction to forward to. So what is .login here? does it do anything? Normally it is used to displath to say a jsp / servlet or calling some resource.
For the values *.xxx*, we usually put it into tiles, if any.
We can define the forward parameter by ".xxx", and this ".xxx" can be referenced in the tiles file. Inside the tiles file, we can defines the title, the header, the footer, and the *real* JSP that this ".xxx" maps to.
Thus, does the code sample ".login" refering to the tiles?
Does the parameter "/login" is Servlet? If not, I suppose it should be a JSP, like this:
Joined: Mar 06, 2001
It cant be another action is it? ( i mean login is an action in the posting)
Joined: Nov 07, 2003
It can be another action, but:
1. If it is another action, it should not be started with "/". 2. If it is another action, it should as the default forward action, which is refers to one of the *forward* parameters in its sub-element forward list, but I think he does not doing so.
Thus, for your case, should the XML be:
Joined: May 17, 2001
Just for the record, I just got this to work! Thank you for all the tips. I found out that part of my problem was that in my jsp file, I was specifying the wrong form name. Here is how I got it to work: