struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slideharmony <setoi...@tiscali.it>
Subject struts2 blank application request parameters
Date Fri, 23 Nov 2007 14:17:23 GMT

I'm really going crazy with struts2 and request parameters, for example look
at the following struts2blankapplication code:




<h3>Languages</h3>
<ul>
    <li>
        <s:url id="url" action="HelloWorld">
            <s:param name="request_locale">en</s:param>
        </s:url>
        <s:a href="%{url}">English</s:a>
    </li>
    <li>
        <s:url id="url" action="HelloWorld">
            <s:param name="request_locale">es</s:param>
        </s:url>
        <s:a href="%{url}">Espanol</s:a>
    </li>
</ul>

Ok, here it add a request parameter called  request_locale to the url to set
the language..

Here is the action:

public class HelloWorld extends ExampleSupport {
    public String execute() throws Exception {
    	setMessage(getText(MESSAGE));
        return SUCCESS;
    }

    public static final String MESSAGE = "HelloWorld.message";
    private String message;

    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
	
}



Ok, how can it set the language if it don't retrieve the request_locale
parameter??

Anybody could explain me how request parameters works?

:-(
-- 
View this message in context: http://www.nabble.com/struts2-blank-application-request-parameters-tf4861986.html#a13913083
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message