Re: html tags in resource bundle
Great Greg I will give your suggestion a try. Thanks Greg Ludington <[EMAIL PROTECTED]> wrote: One possibility would be to create a forward (local or global) for the Action you wish to link, and then, when you save ActionMessages, create the link, and then pass it as a parametric replacement to the message. 1) in struts-config.xml, create a forward that maps to the action link you want in your message, e.g. path="/appRegisterLogin.do"/>. 2) Set your message to have another replacement, like: auditapp.login.duplicate.user.error=A user with email address: {0} already exists. If that is your email address, please use that email address as your login along with the password you were supplied. 3) In your Action, obtain the path of the forward, get its path, and place it in the message. Using your code as a basis: catch(DuplicateUserException dupEx){ log.error("Caught DuplicateUserException in execute of AuditAppRegistrationAction"); // This is the link created from the forward you defined in step 1 String replacementLink = mapping.findForward("appRegisterLoginForward").getPath(); super.saveMessage(request, "auditapp.login.duplicate.user.error", (String)f.get("email"), replacementLink); return mapping.getInputForward(); } This way, the creation and rewriting of the link itself is handled by normal struts mechanisms, and you can manage the links in your struts-config.xml file. On Sat, 10 Jul 2004 17:39:32 -0700 (PDT), Juan Alvarado wrote: > Hello everyone: > > I have recently started using struts again and I am a bit rusty so please bear with > me. I searched the list for what I need and I didn't find anything. > > What I need is to display to a user a message in a JSP. This message is pulled from > an ApplicationResources.properties file. What I would like to do is to be able to > display a link to another page in this particular message. > > My key looks like this: > auditapp.login.duplicate.user.error=A user with email address: {0} already exists. > If that is your email address, please use that email address as your login along > with the password you were supplied. > > As you can see it has a struts specific html tag. This of course didn't work. Does > anyone know of an equivalent way to do this. I could use regular html tags (although > I haven't tried it) but I would like to stick with the struts specific stuff as much > as I can. Especially since it will handle url rewriting for you. The above key gets > pulled from an action with the following code: > ... > > catch(DuplicateUserException dupEx){ > > log.error("Caught DuplicateUserException in execute of > AuditAppRegistrationAction"); > > super.saveMessage(request, "auditapp.login.duplicate.user.error", > (String)f.get("email")); > > return mapping.getInputForward(); > > } > > If you have a solution, ideas or suggestions I would appreciate it if you shared > them with me. > > Thanks in advance. > > Juan > > > - > Do you Yahoo!? > New and Improved Yahoo! Mail - Send 10MB messages! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish.
Re: html tags in resource bundle
One possibility would be to create a forward (local or global) for the Action you wish to link, and then, when you save ActionMessages, create the link, and then pass it as a parametric replacement to the message. 1) in struts-config.xml, create a forward that maps to the action link you want in your message, e.g. . 2) Set your message to have another replacement, like: auditapp.login.duplicate.user.error=A user with email address: {0} already exists. If that is your email address, please use that email address as your login along with the password you were supplied. 3) In your Action, obtain the path of the forward, get its path, and place it in the message. Using your code as a basis: catch(DuplicateUserException dupEx){ log.error("Caught DuplicateUserException in execute of AuditAppRegistrationAction"); // This is the link created from the forward you defined in step 1 String replacementLink = mapping.findForward("appRegisterLoginForward").getPath(); super.saveMessage(request, "auditapp.login.duplicate.user.error", (String)f.get("email"), replacementLink); return mapping.getInputForward(); } This way, the creation and rewriting of the link itself is handled by normal struts mechanisms, and you can manage the links in your struts-config.xml file. On Sat, 10 Jul 2004 17:39:32 -0700 (PDT), Juan Alvarado <[EMAIL PROTECTED]> wrote: > Hello everyone: > > I have recently started using struts again and I am a bit rusty so please bear with > me. I searched the list for what I need and I didn't find anything. > > What I need is to display to a user a message in a JSP. This message is pulled from > an ApplicationResources.properties file. What I would like to do is to be able to > display a link to another page in this particular message. > > My key looks like this: > auditapp.login.duplicate.user.error=A user with email address: {0} already exists. > If that is your email address, please use that email address as your action='/appRegisterLogin'>login along with the password you were > supplied. > > As you can see it has a struts specific html tag. This of course didn't work. Does > anyone know of an equivalent way to do this. I could use regular html tags (although > I haven't tried it) but I would like to stick with the struts specific stuff as much > as I can. Especially since it will handle url rewriting for you. The above key gets > pulled from an action with the following code: > ... > > catch(DuplicateUserException dupEx){ > > log.error("Caught DuplicateUserException in execute of > AuditAppRegistrationAction"); > > super.saveMessage(request, "auditapp.login.duplicate.user.error", > (String)f.get("email")); > > return mapping.getInputForward(); > > } > > If you have a solution, ideas or suggestions I would appreciate it if you shared > them with me. > > Thanks in advance. > > Juan > > > - > Do you Yahoo!? > New and Improved Yahoo! Mail - Send 10MB messages! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html tags in resource bundle
Hello everyone: I have recently started using struts again and I am a bit rusty so please bear with me. I searched the list for what I need and I didn't find anything. What I need is to display to a user a message in a JSP. This message is pulled from an ApplicationResources.properties file. What I would like to do is to be able to display a link to another page in this particular message. My key looks like this: auditapp.login.duplicate.user.error=A user with email address: {0} already exists. If that is your email address, please use that email address as your login along with the password you were supplied. As you can see it has a struts specific html tag. This of course didn't work. Does anyone know of an equivalent way to do this. I could use regular html tags (although I haven't tried it) but I would like to stick with the struts specific stuff as much as I can. Especially since it will handle url rewriting for you. The above key gets pulled from an action with the following code: ... catch(DuplicateUserException dupEx){ log.error("Caught DuplicateUserException in execute of AuditAppRegistrationAction"); super.saveMessage(request, "auditapp.login.duplicate.user.error", (String)f.get("email")); return mapping.getInputForward(); } If you have a solution, ideas or suggestions I would appreciate it if you shared them with me. Thanks in advance. Juan - Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages!
Using jsps from another context with tiles
Hi, I have several common jsps in a common webapp that I like to share with all the webapps, providing a consistent look'n'feel without needing to rewar all of them. With JSTL (c:import, c:url) I was able to use images and other files from that common context, so doing the same with the tiles definitions would be great. I thinked several options - modify the tiles:insert tag so if the jsp is not found in the current context it looks for it in another one - add a "context" attribute to the tiles:insert tag as in c:import - add the context to the xml definitions file Any ideas, suggestions? Thanks Carlos Sanchez A Coruña, Spain Oness Project http://oness.sourceforge.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Dynamic lookup tag lib (drop down list reverse)
Hi all I have created a jsp tag that will look up a collection (of LabelValueBeans) and return the label of the value. For example we store position description in a code table such as Code Description 1Director 2Manager 3Assistant Manager 4Staff In the User table, we store Logon Position Jack 1 Jill 2 Charlie 2 In a UserList.jsp Logon : Position: This will produce the following list Logon : Jack Position: 1 Logon : Jill Position: 2 Logon : Charlie Position: 2 To display the position description instead of the position number, I added a list of LabelValueBeans to the session (ie session.setAttribute("session.positionlevel"); ) and changed the JSP to the following. Logon : Position: The droplist tag will produce the following with Logon : Jack Position: Director Logon : Jill Position: Manager Logon : Charlie Position: Manager I am happy to contribute this back the STRUTS tag lib or if anyone is interested, let me know and I will send you the code. This functionality consists of ma-droplist.tld com.ma.struts.taglib.droplisttag.java com.ma.struts.taglib.droplisttag.class To add the functionality to your JSP you will need to 1) Add the tld to your web.xml. 2) Add the tld to your JSP. This tag also works with indexed beans as droplisttag.java is extended from writetag.java. Regards Michael Mok MAD ART | Lead Technical Architect e| [EMAIL PROTECTED] m| 0417 968 581 This e-mail is the property of MadArt Services and/or its relevant affiliate and may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender and delete all copies of the message. This e-mail (and any attachments hereto) are not intended to be an offer (or an acceptance) and do not create or evidence a binding and enforceable contract between MadArt Services (or any of its affiliates) and the intended recipient or any other party, and may not be relied on by anyone as the basis of a contract by estoppel or otherwise. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: use multiple resource bundles in Validator
Thanks a lot. I can do it in jsp but not in validation.xml. I can find bundle is used in http://jakarta.apache.org/commons/dtds/validator_1_1.dtd but it seems cannot work. I'm now try to update the common-validator and try to check what bundle struts is using in JavascriptValidatorTag.java. If anyone have a better idea please tell me. Thanks a lot. --- In [EMAIL PROTECTED], Van <[EMAIL PROTECTED]> wrote: > On Fri, 9 Jul 2004 14:44:08 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote: > > > -Original Message- > > > From: cliff [mailto:[EMAIL PROTECTED] > > > Sent: Thursday, July 08, 2004 9:34 PM > > > To: [EMAIL PROTECTED] > > > Subject: RE: use multiple resource bundles in Validator > > > > > > > > > I have tried 1.2 but it cannot work. > > > could anyone tell me how to do ? > > > > > > Well according to http://struts.apache.org/userGuide/struts- bean.html#message > > It should be something like: > > > > > > > > > > Thanks a lot > > > > > > From: "Jim Barrows" <[EMAIL PROTECTED]> > > > Date: Fri Jul 9, 2004 4:37 am > > > Subject: RE: use multiple resource bundles in Validator > > > > > > > > > > > > > > > > > > > -Original Message- > > > > From: Van [mailto:[EMAIL PROTECTED] > > > > Sent: Thursday, July 08, 2004 1:12 PM > > > > To: Struts Users Mailing List > > > > Subject: Re: use multiple resource bundles in Validator > > > > > > > > > > > > On Thu, 8 Jul 2004 18:18:41 +0800, Hanna <[EMAIL PROTECTED]> wrote: > > > > > How can i use mulitple message bundles in validator > > > in struts 1.1? > > > > > like the way of ? > > > > > > > > No. > > > > > > Not in 1.1... 1.2 you can. > > > > > I was being a little flippant with my initial one word response of > "No." Partially, this was due to my own irritation when I learned that > it was not possible to specify bundles for property lookups in my > validator configuration files for 1.1. I have heard rumblings about > this possibly being added to the commons validator though. You would > want to check which version of the commons validator is included with > the version of Struts you are using and then check to see whether that > version of the commons validator supports the bundle attribute. If it > is not easy to glean from the project docs, take a gander at the DTD > for the validation configuration files in the version you are using to > see whether the bundle attribute is allowed or not. The commons > validator project home page is here: > > http://jakarta.apache.org/commons/validator/ > > Good luck and please report back to the list in the event that you > find out the bundle support has been added in a recent version of > commons validator. > > Thanks, Van > > Mike "Van" Riper > mailto:[EMAIL PROTECTED] > Silicon Valley Web Developer JUG > https://sv-web-jug.dev.java.net/ > (a.k.a. Sillicon Valley Struts User Group) > http://www.baychi.org/bof/struts/ > > --- -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[oot?] x:parse & x:transform gives Content not allowed in prolog err.
I realy hope someone can help (error and code below). I'm using the latest SAX (sax2r3 downloaded from SF today). Editor is Eclipse 3. Tomcat 5 on Apache via modjk2. I get the following error, doesnt' matter what I try: -- javax.servlet.ServletException: Content is not allowed in prolog. org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex tImpl.java:492) org.apache.jsp.results.basic_jsp._jspService(basic_jsp.java:85) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:320) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:293) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.jav a:1069) org.apache.struts.action.RequestProcessor.processForwardConfig(RequestPr ocessor.java:455) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 279) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1495) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) javax.servlet.http.HttpServlet.service(HttpServlet.java:743) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) JSP: - <%@ page language="java"%> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/x.tld" prefix="x" %> <%@ taglib uri="/WEB-INF/c.tld" prefix="c" %> XSL http://www.w3.org/1999/XSL/Transform";> Do nothing now XML --- John Smith
Re: OT:SOLUTION:Re: Why Ajp13Connector.class is not found in tomcat-jk.jar inTomca 5.x but in Tomca 4.x
This guy constantly asks questions in the same manner, isn't there a way to prevent repeat offenders posting? Christopher On 10/7/04 15:05, "Bryan Hunt" <[EMAIL PROTECTED]> wrote: > I know the solution, for u *NIX users > > vi ~/.procmailrc > > snip= > :0 h > *^Subject:.*I can't bother my ass looking on google so I send noise to > the list > /dev/null > =snip > > > --b > > > Robert Taylor wrote: > >> http://jakarta.apache.org/site/mail2.html#Tomcat >> >> >> >>> -Original Message- >>> From: ganesh gadi [mailto:[EMAIL PROTECTED] >>> Sent: Saturday, July 10, 2004 6:31 AM >>> To: Struts Users Mailing List >>> Subject: Why Ajp13Connector.class is not found in tomcat-jk.jar inTomca >>> 5.x but in Tomca 4.x >>> >>> >>> >>> Hi List, >>> >>> i'm using Tomcat 5.0.19 server. >>> I need to connect Ajp13Connector through Tomcat 5.0.19 >>> >>> I configured in Tomcat. >>> But while i'm running ,NoClassDefFoundException is >>> getting.i.e.,Ajp13Connector.class is not available in "tomcat-jk.jar" >>> But the class is available in Tomcat 4.x in the same jar >>> file(tomcat-jk.jar). >>> Why didn't I find that file in Tomcat 5.x >>> I redownload tomcat 5.x again but i got the same problem. >>> Please give me the solution for that. >>> awaiting for u reply. >>> >>> Thanks >>> Ganesh >>> >>> >>> >>> - >>> Do you Yahoo!? >>> Yahoo! Mail - 50x more storage than other providers! >>> >>> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OT:SOLUTION:Re: Why Ajp13Connector.class is not found in tomcat-jk.jar inTomca 5.x but in Tomca 4.x
I know the solution, for u *NIX users vi ~/.procmailrc snip= :0 h *^Subject:.*I can't bother my ass looking on google so I send noise to the list /dev/null =snip --b Robert Taylor wrote: http://jakarta.apache.org/site/mail2.html#Tomcat -Original Message- From: ganesh gadi [mailto:[EMAIL PROTECTED] Sent: Saturday, July 10, 2004 6:31 AM To: Struts Users Mailing List Subject: Why Ajp13Connector.class is not found in tomcat-jk.jar inTomca 5.x but in Tomca 4.x Hi List, i'm using Tomcat 5.0.19 server. I need to connect Ajp13Connector through Tomcat 5.0.19 I configured in Tomcat. But while i'm running ,NoClassDefFoundException is getting.i.e.,Ajp13Connector.class is not available in "tomcat-jk.jar" But the class is available in Tomcat 4.x in the same jar file(tomcat-jk.jar). Why didn't I find that file in Tomcat 5.x I redownload tomcat 5.x again but i got the same problem. Please give me the solution for that. awaiting for u reply. Thanks Ganesh - Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Why Ajp13Connector.class is not found in tomcat-jk.jar inTomca 5.x but in Tomca 4.x
http://jakarta.apache.org/site/mail2.html#Tomcat > -Original Message- > From: ganesh gadi [mailto:[EMAIL PROTECTED] > Sent: Saturday, July 10, 2004 6:31 AM > To: Struts Users Mailing List > Subject: Why Ajp13Connector.class is not found in tomcat-jk.jar inTomca > 5.x but in Tomca 4.x > > > > Hi List, > > i'm using Tomcat 5.0.19 server. > I need to connect Ajp13Connector through Tomcat 5.0.19 > > I configured in Tomcat. > But while i'm running ,NoClassDefFoundException is getting.i.e.,Ajp13Connector.class > is not available in "tomcat-jk.jar" > But the class is available in Tomcat 4.x in the same jar file(tomcat-jk.jar). > Why didn't I find that file in Tomcat 5.x > I redownload tomcat 5.x again but i got the same problem. > Please give me the solution for that. > awaiting for u reply. > > Thanks > Ganesh > > > > - > Do you Yahoo!? > Yahoo! Mail - 50x more storage than other providers! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Dynamic extension of web apps
Struts has the mechanism to do this too, by the way. What I do is to define tiles, e.g. "html_page", "wap_page", and then reference just "page" in the struts-config.xml. You have the controller detect the device coming in and switch the tiles reference as required. This can also be used, by the way, again, for "skins". This works with, e.g. mapping.getInput(), by the third way. Michael At 02:03 PM 7/8/2004, you wrote: If I understand you correctly (You're looking for a write once, generate HTML, WAP or Voice XML files from that) , I believe JSF will help you in your problem. JSF will allow device independence. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Why Ajp13Connector.class is not found in tomcat-jk.jar inTomca 5.x but in Tomca 4.x
Hi List, i'm using Tomcat 5.0.19 server. I need to connect Ajp13Connector through Tomcat 5.0.19 I configured in Tomcat. But while i'm running ,NoClassDefFoundException is getting.i.e.,Ajp13Connector.class is not available in "tomcat-jk.jar" But the class is available in Tomcat 4.x in the same jar file(tomcat-jk.jar). Why didn't I find that file in Tomcat 5.x I redownload tomcat 5.x again but i got the same problem. Please give me the solution for that. awaiting for u reply. Thanks Ganesh - Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers!
Why Ajp13Connector.class is not found in Tomca 5.x but in Tomca 4.x
Hi List, I need to connect Ajp13Connector through Tomcat 5.0.19 I configured in Tomcat. But while i'm running ,NoClassDefFoundException is getting.i.e.,Ajp13Connector.class is not available in "tomcat-jk.jar" But the class is available in Tomcat 4.x in the same jar file(tomcat-jk.jar). Why didn't I find that file in Tomcat 5.x I redownload tomcat 5.x again but i got the same problem. Please give me the solution for that. awaiting for u reply. Thanks Ganesh - Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage!
Re: Testing for con.close()
Hi, Usually I call con.close() in the final block. There is a mention of this here : http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html#Common%20Problems On Sat, 10 Jul 2004 10:54:31 +0530, Shailender Jain <[EMAIL PROTECTED]> wrote: > Hi, > > I have implemented the connection pooling provided by Struts for > developing my application. > > The application after going live gets hang quite frequently. > The problem may be related to connection not getting closed for some > transactions. > > All the transactions takes atleast 1 minute to complete. > > I assume that the user might be pressing the "STOP" button of the > browser before the transaction gets completed. > Due to this although we take the connection from the pool but not able > to return back as the last lines of the code are > not reached. I think that if i had written con.close() in the finally > block then this problem would have not come. > > Is there any way by which i can specify in the struts config .xml to > close the connection which are not active or not doing anything. > > Regards > Shailender Jain > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]