Yes, you can get it from request. And, comitters, what's your opinion about i18n forwards? Because sometimes i18n enabled message can only solve part of the problem to build a multi-language site, it may require totally different layout for different language, so if we have i18n forwards will be a big help.
--- Ned Nurk <[EMAIL PROTECTED]> 的正文:> > yeah cool, as long as it takes the HttpServlet- or > is there a way to get at > that from the request object? > > From the servlet you can get the ServletContext, > which can then do a > getRealPath() - invaluable if you are trying to see > what actually exists in > your filesystem before determining which file to > return :-) > > regards > ned > > >From: Yunfeng Hou <[EMAIL PROTECTED]> > >Reply-To: "Struts Developers List" > <[EMAIL PROTECTED]> > >To: Struts Developers List > <[EMAIL PROTECTED]> > >Subject: Re: i18n Forwards > >Date: Tue, 15 Jan 2002 11:15:28 +0800 (CST) > > > >Well, how about this, make the ActionMapping > plugable, > >which means, having attribute in struts-config.xml > to > >define the ActionMapping class. ActionMapping > becomes > >an interface having methods as follow, > >findForward(name, request); getInput(request) > >This way, you can get browser type from request and > >determine the forward accordingly. And I think it > will > >be very flexible, and will make minimal change to > >struts. > > > >Yunfeng Hou > > > > --- Ned Nurk <[EMAIL PROTECTED]> 的正文:> > > > What is really needed is a hook to allow the > > > application to translate the > > > forward page name as it sees fit. We have a > system > > > which changes the page > > > name depending on the browser platform which is > > > heirachical eg: > > > > > > default html > > > +-- html for ipac size screens > > > default wml > > > +-- specific wml for nokia > > > +-- wml for large screens > > > > > > the decision tree is loaded in from an XML at > the > > > start of the app. When > > > forwarding to a page, it checks for the most > > > specific version of the file > > > (say wml for large screens), if that doesn't > exist > > > it will look for its > > > parent, and so on. (all cached as well so it > doesnt > > > need to check again) > > > > > > so really want an interface which exposes a > function > > > which takes the input > > > filename, the request and the servlet object (to > get > > > at the app file > > > system). > > > > > > that same interface could be used for Yunfeng's > > > problem too. > > > > > > Regards > > > Ned > > > > > > >From: Yunfeng Hou <[EMAIL PROTECTED]> > > > >Reply-To: "Struts Developers List" > > > <[EMAIL PROTECTED]> > > > >To: [EMAIL PROTECTED] > > > >Subject: Re: i18n Forwards > > > >Date: Tue, 15 Jan 2002 02:38:15 +0800 (CST) > > > > > > > >I am really glad to see this this topic, and > would > > > >like to share some of my thoughts, which I made > > > >modification to struts to make the site work > for > > > both > > > >Chinese and English. > > > >1. Input is also treat as one form of forwards, > so > > > it > > > >can be defined as attribute of action, or > forward > > > of > > > >the action. > > > >2. in struts-config.xml, forwards can be > defined as > > > >follows > > > ><action path="..." input="input.jsp" > > > > ><forward name="success" path="success.jsp"/> > > > ><forward name="success_zh_CN" > > > >path="success_zh_CN.jsp"/> or <forward > > > >name="success_zh_CN" path="zh/success.jsp"/> > > > ><forward name="input_zh_CN" > > > path="input_zh_CN.jsp"/> > > > >or <forward name="input_zh_CN" > > > path="zh/input.jsp"/> > > > >3. add methods in ActionMapping: > > > >findForward(name, request), it will use locale > in > > > >request to find name+"_"+locale first, if not > > > found, > > > >will return findForward(name); > > > >getInput(request), where it will first call > > > >findForward("input",request), if nothing found, > > > will > > > >return getInput(); > > > >4. Modify ActionServlet to call > getInput(request) > > > >instead of getInput() > > > > > > > > > > > > > > > > > > >_________________________________________________________ > > > >Do You Yahoo!? 登录免费雅虎电邮! > > > http://mail.yahoo.com.cn > > > > > > > ><font > > > > >color=#6666FF>无聊?郁闷?高兴?没理由?都来聊天吧!</font>—— > > > >雅虎全新聊天室! > > > http://cn.chat.yahoo.com/c/roomlist.html > > > > > > > >-- > > > >To unsubscribe, e-mail: > > > > ><mailto:[EMAIL PROTECTED]> > > > >For additional commands, e-mail: > > > ><mailto:[EMAIL PROTECTED]> > > > > > > > > > > > > > > > > > > > > >_________________________________________________________________ > > > MSN Photos is the easiest way to share and print > > > your photos: > > > http://photos.msn.com/support/worldwide.aspx > > > > > > > > > -- > > > To unsubscribe, e-mail: > > > > <mailto:[EMAIL PROTECTED]> > > > For additional commands, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > > > > > >_________________________________________________________ > >Do You Yahoo!? 登录免费雅虎电邮! > http://mail.yahoo.com.cn > > > ><font > color=#6666FF>无聊?郁闷?高兴?没理由?都来聊天吧!</font>—— > >雅虎全新聊天室! > http://cn.chat.yahoo.com/c/roomlist.html > > > >-- > >To unsubscribe, e-mail: > ><mailto:[EMAIL PROTECTED]> > >For additional commands, e-mail: > ><mailto:[EMAIL PROTECTED]> > > > > > > > _________________________________________________________________ > Send and receive Hotmail on your mobile device: > http://mobile.msn.com > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > _________________________________________________________ Do You Yahoo!? 登录免费雅虎电邮! http://mail.yahoo.com.cn <font color=#6666FF>无聊?郁闷?高兴?没理由?都来聊天吧!</font>—— 雅虎全新聊天室! http://cn.chat.yahoo.com/c/roomlist.html -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>