Hi,
My question is how do I use my two beans in the JSP code? The first bean
(UserSessionBean) needs the request and the response object and the second
bean is dependent of whether the first bean success in setting a Locale for
the user.
The methods should be called in this order (some kind of pseudocode):
myUserSessionBean.getSession(req, res);
myUserSessionBean.setLocale(req, lang, country); // only if the user sends
language & country
if (myUserSessionBean.gotLocale())
{
mySpecificPageBean.printItAllInternationalized(usersLocale);
}
else
{
defaultBean.printChooseLanguageBean;
}
public class UserSessionBean
{
/**
makes sure that the user has a sessionobject
makes sure that the user is saved in the database
makes sure that the user gets a cookie with his database id
*/
public void getSession(HttpServletRequest request, HttpServletResponse
response);
/**
sets the users Locale and stores it in the Session object and updates
the database
*/
public void setLocale(HttpServletRequest request, String language,
String country);
/**
checks if the user got a Locale
*/
public boolean gotLocale(HttpServletRequest request)
}
This is what I've come up with...
<USEBEAN NAME="user" type="UserSessionBean" LIFESPAN="page">
<!-- don't know -->
</USEBEAN>
<!-- call the methods here? -->
<USEBEAN NAME="mySpecificPageBean" type="NormalPage" LIFESPAN="page">
<SETONCREATE BEANPROPERTY="pagetitle" VALUE="A test page that is
Internationalized">
<!-- how do I send Locale? Should I do it here? -->
</USEBEAN>
<!-- or here? -->
Thank you,
Daniel
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".