Struts 1 log out issue
Hi, I our project we need to put a dynamic log out link,which will come from a properties file. While logging out we want to invalidate the session also. I have written a logout action class where i m invalidating and removing the attribute from the session. Then after success in struts-config.xml file I am redirecting to the log out url,which is hard coded. Does any one know how to access properties file constants into struts-config.xml. And should be the best way to do. Thanks
[Struts 2.1.8.1] Internationalization: how to remain in the current page ?
hi, I have a quick and basic question. Regarding internationalization, whenever a user clicks on a link with a flag, i want to change the locale (language) of the web application. That works well with the i18n interceptor. However i always redirect the user to the home page (home.jsp) when i do that because that is how i have setup the input result : action name=changeLanguage class=ServicesAction method=changeLocale result name=input/home/home.jsp/result /action My JSP looks like this : s:url id=url action=changeLanguage.action s:param name=request_localefr/s:param /s:url s:a href=%{url} theme=xhtmlimg src=%=request.getContextPath()%/images/flag_fr.png //s:a So my question is : how do you specify the current page in the input result name ? so that the user stays on the current page when he changes languages. Thanks for helping.
Re: Struts 1 log out issue
I'm not 100% sure, but ${property-name} might work. -Brian On Fri, Mar 19, 2010 at 3:43 AM, Arpan arpan.deb...@gmail.com wrote: Hi, I our project we need to put a dynamic log out link,which will come from a properties file. While logging out we want to invalidate the session also. I have written a logout action class where i m invalidating and removing the attribute from the session. Then after success in struts-config.xml file I am redirecting to the log out url,which is hard coded. Does any one know how to access properties file constants into struts-config.xml. And should be the best way to do. Thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [Struts 2.1.8.1] Internationalization: how to remain in the current page ?
Hi Celinio, personally, I would build a method that gives back the URL of the page you are currently visiting, including all parameters. You put this method in a superclass of all your actions, so that its available everywhere. In the code you decide which locale parameter to set, according to your current locale. The method in the action class could look something like this: public String getLocaleSwitchURL() { String url = getContextPath() + ServletActionContext.getActionMapping().getName() + .action? + request_locale=; if (getLocale().toString().equals(en_EN)) { url += fr_FR; flagURL = fra.jpg; } else { url += en_EN; flagURL = eng.jpg; } url += ; url += ServletActionContext.getRequest().getQueryString(); return url; } public String getFlagURL() { return getContextPath() + images/ + this.flagURL; } All Strings should of course be configurable, and not hard coded like this. But just to give you an idea how it could work. You output the link like this: a href=s:property value=localeSwitchURL escape=false/ img src=s:property value=flagURL escape=false/ / /a So if the user clicks the link, he will actually call the same page again, with the same parameters. Regards, Ulf On Fri, Mar 19, 2010 at 12:33 PM, Celinio Fernandes cel...@yahoo.comwrote: hi, I have a quick and basic question. Regarding internationalization, whenever a user clicks on a link with a flag, i want to change the locale (language) of the web application. That works well with the i18n interceptor. However i always redirect the user to the home page (home.jsp) when i do that because that is how i have setup the input result : action name=changeLanguage class=ServicesAction method=changeLocale result name=input/home/home.jsp/result /action My JSP looks like this : s:url id=url action=changeLanguage.action s:param name=request_localefr/s:param /s:url s:a href=%{url} theme=xhtmlimg src=%=request.getContextPath()%/images/flag_fr.png //s:a So my question is : how do you specify the current page in the input result name ? so that the user stays on the current page when he changes languages. Thanks for helping.
Re: Struts 1 log out issue
No it doesn't work On Fri, Mar 19, 2010 at 6:19 PM, Brian Thompson elephant...@gmail.comwrote: I'm not 100% sure, but ${property-name} might work. -Brian On Fri, Mar 19, 2010 at 3:43 AM, Arpan arpan.deb...@gmail.com wrote: Hi, I our project we need to put a dynamic log out link,which will come from a properties file. While logging out we want to invalidate the session also. I have written a logout action class where i m invalidating and removing the attribute from the session. Then after success in struts-config.xml file I am redirecting to the log out url,which is hard coded. Does any one know how to access properties file constants into struts-config.xml. And should be the best way to do. Thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 1 log out issue
There are multiple ways to do it. one is to write a piece of code where we can use redirect dispatcher for redirecting to the required url. second on click of logout link take the user to a jsp where session is invalidated , after this forward the user to the desired location. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com On Fri, Mar 19, 2010 at 7:05 PM, Arpan arpan.deb...@gmail.com wrote: No it doesn't work On Fri, Mar 19, 2010 at 6:19 PM, Brian Thompson elephant...@gmail.com wrote: I'm not 100% sure, but ${property-name} might work. -Brian On Fri, Mar 19, 2010 at 3:43 AM, Arpan arpan.deb...@gmail.com wrote: Hi, I our project we need to put a dynamic log out link,which will come from a properties file. While logging out we want to invalidate the session also. I have written a logout action class where i m invalidating and removing the attribute from the session. Then after success in struts-config.xml file I am redirecting to the log out url,which is hard coded. Does any one know how to access properties file constants into struts-config.xml. And should be the best way to do. Thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 1 log out issue
Thanks for the response. Is there any way struts-cofig.xml read any properties file? On Fri, Mar 19, 2010 at 8:06 PM, Girish Naik girish.n...@gmail.com wrote: There are multiple ways to do it. one is to write a piece of code where we can use redirect dispatcher for redirecting to the required url. second on click of logout link take the user to a jsp where session is invalidated , after this forward the user to the desired location. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com On Fri, Mar 19, 2010 at 7:05 PM, Arpan arpan.deb...@gmail.com wrote: No it doesn't work On Fri, Mar 19, 2010 at 6:19 PM, Brian Thompson elephant...@gmail.com wrote: I'm not 100% sure, but ${property-name} might work. -Brian On Fri, Mar 19, 2010 at 3:43 AM, Arpan arpan.deb...@gmail.com wrote: Hi, I our project we need to put a dynamic log out link,which will come from a properties file. While logging out we want to invalidate the session also. I have written a logout action class where i m invalidating and removing the attribute from the session. Then after success in struts-config.xml file I am redirecting to the log out url,which is hard coded. Does any one know how to access properties file constants into struts-config.xml. And should be the best way to do. Thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts2 + Sitemesh + Freemarker doesn't work
Thanks, I actually decided to just build it from source should have just done that in the first place. That got everything mostly working, however, I'm also using the struts-osgi plugin and found a bug where the FreemarkerManager (in osgi it's BundleFreemarkerManager) wasn't looking for result templates in the bundles and so it was failing. I logged an issue and attached a patch that fixes it. https://issues.apache.org/jira/browse/WW-3409 Thanks again, - Jonathan Wes Wannemacher wrote: On Thu, Mar 18, 2010 at 12:02 PM, jonathan doklovic list-rea...@sysbliss.com wrote: I almost have this working, however, it seems that struts-core-2.2.0-SNAPSHOT depends on xwork-2.2.0-SNAPSHOT which doesn't seem to be available anywhere. It's here - http://hudson.zones.apache.org/hudson/view/Struts/job/struts2/193/com.opensymphony$xwork-core/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Freemarker applyDecorator only works on JSP files
Hi, I ran into an issue that others seem to have but I was able to debug a little and get more info on it. The issue is: https://issues.apache.org/jira/browse/WW-1744 Basically, if you try to use the JspTagLib and do: #assign page=JspTaglibs[http://www.opensymphony.com/sitemesh/page;] @pg.applyDecorator page=/some-page.ftl name=some-decorator / It only works if the main result page requested is a JSP page. If the main page is a freemarker page, it just doesn't include the applyDecorator content. Thought I'd mail the list and see if anyone had any ideas on what to look for so I can try to debug/fix the issue. Thanks, - Jonathan - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org