struts 1: id attribute in html:messages.../ tag
Hi, Can anyone explain what should be used as the id value in the html:messages id=... .../ tag? Where to define it? I read the doc (http://struts.apache.org/1.3.10/struts-taglib/tlddoc/html/messages.html) but can't figure it out. In Action class, ActionMessages messages = new ActionMessages(); messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(error.success)); // error.success is a property key, already defined addMessages(request, messages); In the view, I used this code to try to render the message. html:messages id=... message=true bean:write name=msg / /html:messages What should be used as the id value? Thanks. -- View this message in context: http://old.nabble.com/struts-1%3A-id-attribute-in-%3Chtml%3Amessages...-%3E-tag-tp27442814p27442814.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
html:messages
hello all i've a new-user page (say new_user.jsp) . am inserting a new user into db. after inserting am mapping my page to new_user.jsp . what my doubt is i've to display a message User created successfully. how do i do it? help me out of this please. note : am setting redirect=true in my struts-config.xml . If i don't set redirect=true it'll lead for duplicate entry on db. -- View this message in context: http://www.nabble.com/html%3Amessages-tp21556740p21556740.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: html:messages
In your action method use addActionMessage. Then in the jsp page use s:actionmessage/ to display the message(s) in the list. You will be using the MessageStoreInterceptor. If you are using 2.1.6 make sure the store interceptor is in your stack in struts.xml. If you are using an earlier version you need to register the interceptor and then add it to your stack: interceptor name=store class=org.apache.struts2.interceptor.MessageStoreInterceptor/ interceptor-stack ... interceptor-ref name=store AUTOMATIC /interceptor -D m.harig wrote: hello all i've a new-user page (say new_user.jsp) . am inserting a new user into db. after inserting am mapping my page to new_user.jsp . what my doubt is i've to display a message User created successfully. how do i do it? help me out of this please. note : am setting redirect=true in my struts-config.xml . If i don't set redirect=true it'll lead for duplicate entry on db. -- View this message in context: http://www.nabble.com/html%3Amessages-tp21556740p21557132.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: html:messages
Thanks for replying me. am using struts 1.2 . how do i do it in struts 1.2 dusty wrote: In your action method use addActionMessage. Then in the jsp page use s:actionmessage/ to display the message(s) in the list. You will be using the MessageStoreInterceptor. If you are using 2.1.6 make sure the store interceptor is in your stack in struts.xml. If you are using an earlier version you need to register the interceptor and then add it to your stack: interceptor name=store class=org.apache.struts2.interceptor.MessageStoreInterceptor/ interceptor-stack ... interceptor-ref name=store AUTOMATIC /interceptor -D m.harig wrote: hello all i've a new-user page (say new_user.jsp) . am inserting a new user into db. after inserting am mapping my page to new_user.jsp . what my doubt is i've to display a message User created successfully. how do i do it? help me out of this please. note : am setting redirect=true in my struts-config.xml . If i don't set redirect=true it'll lead for duplicate entry on db. -- View this message in context: http://www.nabble.com/html%3Amessages-tp21556740p21557339.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: html:messages problem?
Hi Please check the error key which ur using in validation.xml is present in Resources properties. Thanks and Regards On 5/23/06, Yang Sun [EMAIL PROTECTED] wrote: Hi, I am using struts 1.2.9 for my project now. And for validating the user input, I use DynaValidationForm and validation.xml to rule the user input. At the client side (web page), I use the following code to show the error information to the user. logic:messagesPresent message=false tr td html:messages id=error bean:write name=error/ /html:messages /td /tr /logic:messagesPresent But the error I got related to bean:write tag, the error log said: javax.servlet.jsp.JspException: ServletException in '/WEB-INF/view/layouts/centerlayout.jsp': ServletException in '/WEB-INF/view/user/login/login.jsp': Cannot find bean: error in any scope From the document, I see that html:messages will put the error variable into the page scope. But why bean:write cannot find the error variable? I also have a simple test that I change the bean:write to a constant string, say aaa. Then the output will be some aaa strings (depends on how many errors detected). So I guess may be html:messages have not put the error into the scope. Please help me to have a look at it. Thanks. Regards, Yang
html:messages problem?
Hi, I am using struts 1.2.9 for my project now. And for validating the user input, I use DynaValidationForm and validation.xml to rule the user input. At the client side (web page), I use the following code to show the error information to the user. logic:messagesPresent message=false tr td html:messages id=error bean:write name=error/ /html:messages /td /tr /logic:messagesPresent But the error I got related to bean:write tag, the error log said: javax.servlet.jsp.JspException: ServletException in '/WEB-INF/view/layouts/centerlayout.jsp': ServletException in '/WEB-INF/view/user/login/login.jsp': Cannot find bean: error in any scope From the document, I see that html:messages will put the error variable into the page scope. But why bean:write cannot find the error variable? I also have a simple test that I change the bean:write to a constant string, say aaa. Then the output will be some aaa strings (depends on how many errors detected). So I guess may be html:messages have not put the error into the scope. Please help me to have a look at it. Thanks. Regards, Yang
Common Resource bundles across web projects, ActionMessage and html:messages
Title: Common Resource bundles across web projects, ActionMessage and html:messages Hi all, We are using the ActionMessage-s with replacement values. We want to divide the resource bundles so that we have a 'common-layout-jar' which contains common messages in 'GeneralMessages.properties' and so the application war itself contains *all application specific messages* in 'ApplicationResources.properties', the last one set up as the default bundle in struts-config.xml. Generally, it seems that resource bundle texts from the default bundle *only* are accessible for an ActionMessage contructor by their key - (new ActionMessage(String key, Object o);) Therefore, from our experience, all bundle texts with *replacement objects* specifically, must be placed in the *default bundle*. If not, the ActionMessage contructor with key (or possibly the html:messages... tag) and replacement values does not play - and an JspException is generated, see below. Does anyone have a solution to this, we want to refer *directly* to message keys in common resource bundles instead of having to concatenating strings manually. (That is the workaround we found to work if we insist on having the common messages once and for all defined in the common layout jar.) Thanks! Regards, Gudny H. --- Code example: In the Action-class: ActionMessages messages = new ActionMessages(); ActionMessage(general.textWithOneReplacementValue, replacementValue); messages.add(Globals.MESSAGE_KEY, msg); Message associated with the key in the resource bundle: general.textWithOneReplacementValue= Some message with one replacement value: '{0}' The JSP code we used for outputting the messages is: html:messages id=msg message=true bean:write name=msg /br/ /html:messages If general.textWithOneReplacementValue property is placed in other than the default bundle, this JspException is generated: 2006-03-16 10:45:03,779 ERROR [[/nims-web-5.0-SNAPSHOT].[action]] Servlet.service() for servlet action threw exception javax.servlet.jsp.JspException: Cannot find bean: msg in any scope. --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Common Resource bundles across web projects, ActionMessage and html:messages
When you use messages from an alternate (i.e. non default) message resources you need to specify the bundle attribute in the html:messages tag. So if you have something like this in your struts-config,xml: message-resources parameter=ApplicationResources/ message-resources parameter='GeneralMessages key=common / Then to use your 'GeneralMessages in your jsp you specify bundle=common: html:messages id=msg message=true bundle=common bean:write name=msg /br/ /html:messages I notice that you are storing your messages using a property of Globals.MESSAGE_KEY - often people get confused between the property the message is associated with in the ActionMessages object and the request attribute under which that ActionMessages object is stored. Globals.MESSAGE_KEY is usually used as the request attribute key - rather than the propery a message is associated with in ActionMessages. You may be wanting to store messages from different bundles in the same ActionMessages object. The only way to do this would be to store them under different property names in the ActionMessages and then use that property in the jsp tags to filter messages for a specific resources bundle: ActionMessages messages = new ActionMessages(); messages.add(defaultFoo, new ActionMessage(...); messages.add(commonBar, new ActionMessage(...); saveMessages(request, messages); then in your jsp: html:messages id=msg message=true property=defaultFoo bean:write name=msg /br/ /html:messages html:messages id=msg message=true bundle=common property=commonBar bean:write name=msg /br/ /html:messages This is however a misuse of what property was designed for and it would be better to store messages from different bundles in different ActionMessages objects ActionMessages defaultMsgs = new ActionMessages(); defaultMsgs.add(foo, new ActionMessage(...); saveMessages(request, defaultMsgs); ActionMessages commonMsgs = new ActionMessages(); commonMsgs.add(bar, new ActionMessage(...); request.setAttribute(commonMsgs, commonMsgs); ...then in your jsp html:messages id=msg message=true bean:write name=msg /br/ /html:messages html:messages id=msg name=commonMsgs bundle=common property=commonBar bean:write name=msg /br/ /html:messages More info here http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html Niall On 3/16/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi all, We are using the ActionMessage-s with replacement values. We want to divide the resource bundles so that we have a 'common-layout-jar' which contains common messages in 'GeneralMessages.properties' and so the application war itself contains *all application specific messages* in 'ApplicationResources.properties', the last one set up as the default bundle in struts-config.xml. Generally, it seems that resource bundle texts from the default bundle *only* are accessible for an ActionMessage contructor by their key - (new ActionMessage(String key, Object o);) Therefore, from our experience, all bundle texts with *replacement objects* specifically, must be placed in the *default bundle*. If not, the ActionMessage contructor with key (or possibly the html:messages... tag) and replacement values does not play - and an JspException is generated, see below. Does anyone have a solution to this, we want to refer *directly* to message keys in common resource bundles instead of having to concatenating strings manually. (That is the workaround we found to work if we insist on having the common messages once and for all defined in the common layout jar.) Thanks! Regards, Gudny H. --- Code example: In the Action-class: ActionMessages messages = new ActionMessages(); ActionMessage(general.textWithOneReplacementValue, replacementValue); messages.add(Globals.MESSAGE_KEY, msg); Message associated with the key in the resource bundle: general.textWithOneReplacementValue= Some message with one replacement value: '{0}' The JSP code we used for outputting the messages is: html:messages id=msg message=true bean:write name=msg /br/ /html:messages If general.textWithOneReplacementValue property is placed in other than the default bundle, this JspException is generated: 2006-03-16 10:45:03,779 ERROR [[/nims-web-5.0-SNAPSHOT].[action]] Servlet.service() for servlet action threw exception javax.servlet.jsp.JspException: Cannot find bean: msg in any scope. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:messages or html:errors???
html:errors isn't deprecated - both html:errors and html:messages offer different ways of doing the same thing. When it comes to displaying a message against a single property, html:errors is easier and the issue of including markup in resource bundles doesn't arise. http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html Niall - Original Message - From: Jubin Kuriakose [EMAIL PROTECTED] Sent: Tuesday, March 14, 2006 3:04 AM Hi fea html:errors/ is deprecated as it doesn't allow html styling to the messages, the only way thats possible is through the reasource bundle which is bad design priciple. html:messages allow messages to be formatted using html. here is an eg. font color=green logic:messagesPresent name=fincoreMsgQueue div class=headersimg src=minus.gif class=showstate onClick=expandcontent(this, 'sc1') / Message Queues/div div id=sc1 class=switchcontent html:messages id=msgQueue name=fincoreMsgQueue libean:write name=msgQueue//li /html:messages /div /logic:messagesPresent /font jubs On 3/13/06, fea jabi [EMAIL PROTECTED] wrote: Using struts 1.2.7 which one to use? html:messages or html:errors?? I am using html:errors now and displaying errors for each property i.eusing html:errors property=custName/ Just wondering why html:messages is available? when this tag can be used? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:messages or html:errors???
Using struts 1.2.7 which one to use? html:messages or html:errors?? I am using html:errors now and displaying errors for each property i.e using html:errors property=custName/ Just wondering why html:messages is available? when this tag can be used? Thanks. _ Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:messages or html:errors???
On 3/13/06, fea jabi [EMAIL PROTECTED] wrote: Using struts 1.2.7 which one to use? html:messages or html:errors?? http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:messages or html:errors???
Hi fea html:errors/ is deprecated as it doesn't allow html styling to the messages, the only way thats possible is through the reasource bundle which is bad design priciple. html:messages allow messages to be formatted using html. here is an eg. font color=green logic:messagesPresent name=fincoreMsgQueue div class=headersimg src=minus.gif class=showstate onClick=expandcontent(this, 'sc1') / Message Queues/div div id=sc1 class=switchcontent html:messages id=msgQueue name=fincoreMsgQueue libean:write name=msgQueue//li /html:messages /div /logic:messagesPresent /font jubs On 3/13/06, fea jabi [EMAIL PROTECTED] wrote: Using struts 1.2.7 which one to use? html:messages or html:errors?? I am using html:errors now and displaying errors for each property i.eusing html:errors property=custName/ Just wondering why html:messages is available? when this tag can be used? Thanks. _ Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:messages
Greetings, I am unable to find a solution... even after searching... and waiting for the espresso to kick in. I have messages and would like to determine the number of messages in the bean. If there is more than one message format the output as a list or else just display the message. Unable to come up with something. This is what I am currently using: logic:messagesPresent message=true tr td colspan=5 class=informationalMessage html-el:messages id=message message=true bean: write name=message filter=false/br /html-el:messages /td td/td /tr tr td colspan=6 height=5/td /tr /logic:messagesPresent Any ideas would be greatly appreciated ! - Glenn
html:messages not displaying all messages
I have the following in an action class: msgs.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(This is an Action-inserted error,false)); msgs.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(So is this,false)); addErrors(request,msgs); (Notice that I'm trying out the resource-free ActionMessage from 1.2.7) Using html:messages/ as follows, I only get the first message: html:messages id=someMessagec:out value=${someMessage}/ /html:messages If I just use html:errors/, I get both messages. Am I missing something with html:messages/? -- Jeff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:messages help
Hi, I am having trouble getting messages to display using the html:messages tag. I have tried to help myself and followed the struts docs but I can't seem to get this to work. The html:errors tag works fine. Here's what I am trying to do: I have an action that is trying to add a global message if a certain action is successful. code-snippet ActionMessages messages = new ActionMessages(); messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(mesg.pwResetSuccess)); if (!messages.isEmpty()) saveMessages(request, messages); forward = mapping.findForward(GLOBAL_FORWARDS.LOGIN); /code-snippet As you can see I create a messages object, stick my message in it as global and save it. This is pretty much verbatim from the struts user guide. I ran this through a debugger and all code is being executed. This forwards to a jsp page that has the following inside it: code-snippet ul html:messages id=message lic:out value=${message} //li /html:messages /ul /code-snippet When the browser renders the page I get no messages. Any ideas? Thanks, Ross - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:messages help
if (!messages.isEmpty()) saveMessages(request, messages); use addMessages(). saveMessages has been deprecated. ul html:messages id=message lic:out value=${message} //li /html:messages /ul You left out the message attribute. Set it to true. ul html:messages id=message message=true lic:out value=${message} //li /html:messages /ul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:messages help
Hi, Thanks for the response, but no dice, still doesn't work. I changed the jsp to the following: code-snippet ul html:messages id=message message=true lic:out value=${message} //li /html:messages /ul /code-snippet I am using Struts 1.1 so I don't have access to addMessages(). Any other suggestions? Thanks, Ross Yan Hu wrote: if (!messages.isEmpty()) saveMessages(request, messages); use addMessages(). saveMessages has been deprecated. ul html:messages id=message lic:out value=${message} //li /html:messages /ul You left out the message attribute. Set it to true. ul html:messages id=message message=true lic:out value=${message} //li /html:messages /ul - 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: html:messages help
Try the following... Don't forget to import struts-bean.tld %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % I think it is better to use struts-tags when possible since they were designed for Struts. ul html:messages id=message message=true li bean:write name=message//li /html:messages /ul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:messages help
Hi, Thanks again but still not working. I tried as you suggested. I don't think it is a problem with the c:out tag anyway because when I look at what the browser gets I see ul /ul And not ul li /li /ul Anyway, I will get the struts source and step through the html:messages code, perhaps there is something fishy going on in there. Ross Yan Hu wrote: Try the following... Don't forget to import struts-bean.tld %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % I think it is better to use struts-tags when possible since they were designed for Struts. ul html:messages id=message message=true li bean:write name=message//li /html:messages /ul - 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: html:messages help
Any chance that you are missing the include for struts-html? %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % Granted I'm using 1.2, but I'm still using the saveMessages(request, messages) and using this to display messages and errors: logic:messagesPresent html:errors/ /logic:messagesPresent logic:messagesPresent message=true html:messages id=msg message=true header=message.header footer=message.footer lifont color=bluebean:write name=msg //font/li /html:messages /logic:messagesPresent Ross Gibb wrote: Hi, Thanks for the response, but no dice, still doesn't work. I changed the jsp to the following: code-snippet ul html:messages id=message message=true lic:out value=${message} //li /html:messages /ul /code-snippet I am using Struts 1.1 so I don't have access to addMessages(). Any other suggestions? Thanks, Ross Yan Hu wrote: if (!messages.isEmpty()) saveMessages(request, messages); use addMessages(). saveMessages has been deprecated. ul html:messages id=message lic:out value=${message} //li /html:messages /ul You left out the message attribute. Set it to true. ul html:messages id=message message=true lic:out value=${message} //li /html:messages /ul - 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]
Re: html:messages help
This could be something. I do have the taglib definition but I am using the el version, so mine looks like this: %@ taglib uri=http://jakarta.apache.org/struts/tags-html-el; prefix=html% Would that make a difference? I will try it the other way. Brad Balmer wrote: Any chance that you are missing the include for struts-html? %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % Granted I'm using 1.2, but I'm still using the saveMessages(request, messages) and using this to display messages and errors: logic:messagesPresent html:errors/ /logic:messagesPresent logic:messagesPresent message=true html:messages id=msg message=true header=message.header footer=message.footer lifont color=bluebean:write name=msg //font/li /html:messages /logic:messagesPresent Ross Gibb wrote: Hi, Thanks for the response, but no dice, still doesn't work. I changed the jsp to the following: code-snippet ul html:messages id=message message=true lic:out value=${message} //li /html:messages /ul /code-snippet I am using Struts 1.1 so I don't have access to addMessages(). Any other suggestions? Thanks, Ross Yan Hu wrote: if (!messages.isEmpty()) saveMessages(request, messages); use addMessages(). saveMessages has been deprecated. ul html:messages id=message lic:out value=${message} //li /html:messages /ul You left out the message attribute. Set it to true. ul html:messages id=message message=true lic:out value=${message} //li /html:messages /ul - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:messages help
Hi Ross, I know this maybe can't make any sense but i got this problem once due to some mistakes handling scopes. Let me explain: I had an Action instance that did some stuff and in case of errors, put them all in the request and forward to the next view. But my next view was a forward action (a global forward) to a jsp error page. So, when the forward action was executed, the messages saved in the request were lost, resulting in no error messages rendered in my jsp page. May this be your situation? Hope that helped. Cheers, Daniel Silva. On 7/12/05, Ross Gibb [EMAIL PROTECTED] wrote: This could be something. I do have the taglib definition but I am using the el version, so mine looks like this: %@ taglib uri=http://jakarta.apache.org/struts/tags-html-el; prefix=html% Would that make a difference? I will try it the other way. Brad Balmer wrote: Any chance that you are missing the include for struts-html? %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % Granted I'm using 1.2, but I'm still using the saveMessages(request, messages) and using this to display messages and errors: logic:messagesPresent html:errors/ /logic:messagesPresent logic:messagesPresent message=true html:messages id=msg message=true header=message.header footer=message.footer lifont color=bluebean:write name=msg //font/li /html:messages /logic:messagesPresent Ross Gibb wrote: Hi, Thanks for the response, but no dice, still doesn't work. I changed the jsp to the following: code-snippet ul html:messages id=message message=true lic:out value=${message} //li /html:messages /ul /code-snippet I am using Struts 1.1 so I don't have access to addMessages(). Any other suggestions? Thanks, Ross Yan Hu wrote: if (!messages.isEmpty()) saveMessages(request, messages); use addMessages(). saveMessages has been deprecated. ul html:messages id=message lic:out value=${message} //li /html:messages /ul You left out the message attribute. Set it to true. ul html:messages id=message message=true lic:out value=${message} //li /html:messages /ul - 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] - 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: html:messages help
Hi Daniel, Ah yes, that was exactly it, thanks. It may have taken me a long time to figure that out. To save me even more time what was your solution? The global forward I am forwarding to looks like the following in struts-config.xml: global-forwards forward name=login path=/login.do redirect=true/ /global-forwards I want to display a message at the top using html:messages. I seem to recall needing the redirect set to true but I can't remember why. Is that affecting it? Thanks, Ross Daniel Henrique Ferreira e Silva wrote: Hi Ross, I know this maybe can't make any sense but i got this problem once due to some mistakes handling scopes. Let me explain: I had an Action instance that did some stuff and in case of errors, put them all in the request and forward to the next view. But my next view was a forward action (a global forward) to a jsp error page. So, when the forward action was executed, the messages saved in the request were lost, resulting in no error messages rendered in my jsp page. May this be your situation? Hope that helped. Cheers, Daniel Silva. On 7/12/05, Ross Gibb [EMAIL PROTECTED] wrote: This could be something. I do have the taglib definition but I am using the el version, so mine looks like this: %@ taglib uri=http://jakarta.apache.org/struts/tags-html-el; prefix=html% Would that make a difference? I will try it the other way. Brad Balmer wrote: Any chance that you are missing the include for struts-html? %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % Granted I'm using 1.2, but I'm still using the saveMessages(request, messages) and using this to display messages and errors: logic:messagesPresent html:errors/ /logic:messagesPresent logic:messagesPresent message=true html:messages id=msg message=true header=message.header footer=message.footer lifont color=bluebean:write name=msg //font/li /html:messages /logic:messagesPresent Ross Gibb wrote: Hi, Thanks for the response, but no dice, still doesn't work. I changed the jsp to the following: code-snippet ul html:messages id=message message=true lic:out value=${message} //li /html:messages /ul /code-snippet I am using Struts 1.1 so I don't have access to addMessages(). Any other suggestions? Thanks, Ross Yan Hu wrote: if (!messages.isEmpty()) saveMessages(request, messages); use addMessages(). saveMessages has been deprecated. ul html:messages id=message lic:out value=${message} //li /html:messages /ul You left out the message attribute. Set it to true. ul html:messages id=message message=true lic:out value=${message} //li /html:messages /ul - 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] - 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]
Re: html:messages help
To answer my own question, in this case I was able to remove the redirect attribute and everything works. If I couldn't do that I would have had to stick the messages in the session. Thanks, Ross Ross Gibb wrote: Hi Daniel, Ah yes, that was exactly it, thanks. It may have taken me a long time to figure that out. To save me even more time what was your solution? The global forward I am forwarding to looks like the following in struts-config.xml: global-forwards forward name=login path=/login.do redirect=true/ /global-forwards I want to display a message at the top using html:messages. I seem to recall needing the redirect set to true but I can't remember why. Is that affecting it? Thanks, Ross Daniel Henrique Ferreira e Silva wrote: Hi Ross, I know this maybe can't make any sense but i got this problem once due to some mistakes handling scopes. Let me explain: I had an Action instance that did some stuff and in case of errors, put them all in the request and forward to the next view. But my next view was a forward action (a global forward) to a jsp error page. So, when the forward action was executed, the messages saved in the request were lost, resulting in no error messages rendered in my jsp page. May this be your situation? Hope that helped. Cheers, Daniel Silva. On 7/12/05, Ross Gibb [EMAIL PROTECTED] wrote: This could be something. I do have the taglib definition but I am using the el version, so mine looks like this: %@ taglib uri=http://jakarta.apache.org/struts/tags-html-el; prefix=html% Would that make a difference? I will try it the other way. Brad Balmer wrote: Any chance that you are missing the include for struts-html? %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % Granted I'm using 1.2, but I'm still using the saveMessages(request, messages) and using this to display messages and errors: logic:messagesPresent html:errors/ /logic:messagesPresent logic:messagesPresent message=true html:messages id=msg message=true header=message.header footer=message.footer lifont color=bluebean:write name=msg //font/li /html:messages /logic:messagesPresent Ross Gibb wrote: Hi, Thanks for the response, but no dice, still doesn't work. I changed the jsp to the following: code-snippet ul html:messages id=message message=true lic:out value=${message} //li /html:messages /ul /code-snippet I am using Struts 1.1 so I don't have access to addMessages(). Any other suggestions? Thanks, Ross Yan Hu wrote: if (!messages.isEmpty()) saveMessages(request, messages); use addMessages(). saveMessages has been deprecated. ul html:messages id=message lic:out value=${message} //li /html:messages /ul You left out the message attribute. Set it to true. ul html:messages id=message message=true lic:out value=${message} //li /html:messages /ul - 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] - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Html:messages vs html:errors
Still not displaying messages, here is what I have so far. struts-config.xml entry: snip ...controller/ message-resources id=ApplicationResources key=ApplicationResources null=false parameter=ApplicationResources/ plug-in className=org.apache.struts.tiles.TilesPlugin... The ApplicationResources.properties file is located at /WEB-INF/classes/ApplicationResources.properties it contains: snip ... label.phone.number=Phone Number label.welcome=Welcome back {0} {1}\! message.body={0} error.detail={0} error.min.length=The input must be at least {0} characters in length. error.max.length=The input cannot be longer than {0} characters in length. errors.required={0} is required. errors.invalid={0} is invalid. ... /snip I have log4j setup with log4j.logger.org.apache.struts=DEBUG,A1,A2 and on startup the log4j related output is: 656 DEBUG [main] action.ActionServlet - Initializing module path '' message resources from 'ApplicationResources' 656 INFO [main] util.PropertyMessageResources - Initializing, config='ApplicationResources', returnNull=true I have an Action that forwards to a jsp, the action execute has: snip ... if (uri.indexOf(Al) = 0){ ActionMessages messages = new ActionMessages(); messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(message.body,retStatus)); this.saveMessages(request, messages); } ... /snip where uri is a string variable of the resource the action is looking at, and retStatus is a string that contains the status of the request. The jsp has near the top if the body tile snip tiles:put name=body type=string hr align=left width=800 color=#00 noshade logic:messagesPresent message=true h3font color=redMessages:/font/h3 ul html:messages id=msg libean:write name=msg //li /html:messages /ul /logic:messagesPresent ...the rest of the body /snip When I test this setup, when the uri contains 'Al' I get the red Messages: as I suspect, but no list of messages under it. When I traverse a resource without the 'Al' in the uri, I do NOT get the red Messages:. I have verified that xerces and the ApplicationResources are loaded from the Catalina log: 2005-04-06 09:00:02 WebappLoader[/AJDocMan]: Deploy JAR /WEB-INF/lib/struts.jar to C:\Java\ArchivedWorkspaces\AJDocMan\WebContent\WEB-INF\lib\struts.jar 2005-04-06 09:00:02 WebappLoader[/AJDocMan]: Deploy JAR /WEB-INF/lib/xercesImpl.jar to C:\Java\ArchivedWorkspaces\AJDocMan\WebContent\WEB-INF\lib\xercesImpl.ja r 2005-04-06 09:00:03 WebappLoader[/AJDocMan]: Deploy JAR /WEB-INF/lib/xmlParserAPIs.jar to C:\Java\ArchivedWorkspaces\AJDocMan\WebContent\WEB-INF\lib\xmlParserAPIs .jar 2005-04-06 09:00:03 ContextConfig[/AJDocMan]:Adding path '/WEB-INF/lib/xercesImpl.jar' 2005-04-06 09:00:03 ContextConfig[/AJDocMan]:Adding path '/WEB-INF/lib/xmlParserAPIs.jar' 2005-04-06 09:00:07,500 DEBUG [main] action.ActionServlet (ActionServlet.java:1209) - Initializing module path '' message resources from 'ApplicationResources' 2005-04-06 09:00:07,500 INFO [main] util.PropertyMessageResources (PropertyMessageResources.java:127) - Initializing, config='ApplicationResources', returnNull=true These are the xerces-2_6_2 jars from the dist. What can I check next? Michael Oliver CTO Alarius Systems LLC 3325 N. Nellis Blvd, #1 Las Vegas, NV 89115 Phone:(702)643-7425 Fax:(702)974-0341 *Note new email changed from [EMAIL PROTECTED] -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 05, 2005 5:09 PM To: Struts Users Mailing List Subject: Re: Html:messages vs html:errors One cause of this is if it can't find the message key in your application resources and you have your message resources configured with null=true. If you change your message resources config to null=false in your struts-config.xml message-resources null=false parameter=myPackage.ApplicationResources/ Then if it can't find the message for some reason, you should get the following displayed. h3font color=red/fontMessages:/h3 ul li ???en_US.error.detail/li /ul Another cause...do you have the taglib declaration for the html tags at the top of your page? Anyway, what you have looks good, just a matter of debugging which bits of struts are not configured properly. Nialll - Original Message - From: Michael Oliver [EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 12:25 AM I tried the example from the HelpTagsErrorsAndMessages.html in my jsp near the top of the body. logic:messagesPresent h3font color=red/fontMessages:/h3 ul html:messages id=msg libean:write name=msg //li /html:messages /ul /logic:messagesPresent The action that forwards to that jsp has: ActionErrors errors = new ActionErrors(); errors.add(ActionErrors.GLOBAL_MESSAGE, new ActionMessage
Re: Html:messages vs html:errors
The problem is with how you've configured your messages resources. Because you've specified a key your message resources are not being stored under the default messages resources key. There being stored under the bundle key ApplicationResources. You just need to remove that (and the id, its unnecessary) and have the following... message-resources null=false parameter=ApplicationResources/ If you do specify a key value in the message-resources element, then you need to use the same value in the bundle attribute of the JSP tags, something like the following should work with what you had set up... bean:message key=myMessage.key bundle=ApplicationResources / I'm going to post an update to the page I originally put up which includes info on this - I'll post to the list when its ready. Niall - Original Message - From: Michael Oliver [EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 5:12 PM Still not displaying messages, here is what I have so far. struts-config.xml entry: snip ...controller/ message-resources id=ApplicationResources key=ApplicationResources null=false parameter=ApplicationResources/ plug-in className=org.apache.struts.tiles.TilesPlugin... The ApplicationResources.properties file is located at /WEB-INF/classes/ApplicationResources.properties it contains: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Html:messages vs html:errors
Thanks, But ARG That wasn't it. I changed the message-resources tag as you suggest, message-resources null=false parameter=ApplicationResources/ however I am still not displaying any messages not even the ???null??? there are also no exceptions in the log. Is there some other package I can add a logger for that might yield a hint as to what's going on? Michael Oliver CTO Alarius Systems LLC 3325 N. Nellis Blvd, #1 Las Vegas, NV 89115 Phone:(702)643-7425 Fax:(702)974-0341 *Note new email changed from [EMAIL PROTECTED] -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 11:30 AM To: Struts Users Mailing List Subject: Re: Html:messages vs html:errors The problem is with how you've configured your messages resources. Because you've specified a key your message resources are not being stored under the default messages resources key. There being stored under the bundle key ApplicationResources. You just need to remove that (and the id, its unnecessary) and have the following... message-resources null=false parameter=ApplicationResources/ If you do specify a key value in the message-resources element, then you need to use the same value in the bundle attribute of the JSP tags, something like the following should work with what you had set up... bean:message key=myMessage.key bundle=ApplicationResources / I'm going to post an update to the page I originally put up which includes info on this - I'll post to the list when its ready. Niall - Original Message - From: Michael Oliver [EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 5:12 PM Still not displaying messages, here is what I have so far. struts-config.xml entry: snip ...controller/ message-resources id=ApplicationResources key=ApplicationResources null=false parameter=ApplicationResources/ plug-in className=org.apache.struts.tiles.TilesPlugin... The ApplicationResources.properties file is located at /WEB-INF/classes/ApplicationResources.properties it contains: - 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: Html:messages vs html:errors
Michael, Are you capturing exceptions in the jsp? (i.e. do you wrap a giant try catch block or something?) I ask this because it must be finding the message since if a key is not found you should get an exception along the lines of Cannot find message resource for key (I cant remember the exact text) and sorry I cant see your entire text. Can you forward the applicationResources file and the jsp bean:message call to me? You could turn your logging to debug for org.apache.struts.util and that may help you some also. Al -Original Message- From: Michael Oliver [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 2:14 PM To: 'Struts Users Mailing List' Subject: RE: Html:messages vs html:errors Thanks, But ARG That wasn't it. I changed the message-resources tag as you suggest, message-resources null=false parameter=ApplicationResources/ however I am still not displaying any messages not even the ???null??? there are also no exceptions in the log. Is there some other package I can add a logger for that might yield a hint as to what's going on? Michael Oliver CTO Alarius Systems LLC 3325 N. Nellis Blvd, #1 Las Vegas, NV 89115 Phone:(702)643-7425 Fax:(702)974-0341 *Note new email changed from [EMAIL PROTECTED] -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 11:30 AM To: Struts Users Mailing List Subject: Re: Html:messages vs html:errors The problem is with how you've configured your messages resources. Because you've specified a key your message resources are not being stored under the default messages resources key. There being stored under the bundle key ApplicationResources. You just need to remove that (and the id, its unnecessary) and have the following... message-resources null=false parameter=ApplicationResources/ If you do specify a key value in the message-resources element, then you need to use the same value in the bundle attribute of the JSP tags, something like the following should work with what you had set up... bean:message key=myMessage.key bundle=ApplicationResources / I'm going to post an update to the page I originally put up which includes info on this - I'll post to the list when its ready. Niall - Original Message - From: Michael Oliver [EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 5:12 PM Still not displaying messages, here is what I have so far. struts-config.xml entry: snip ...controller/ message-resources id=ApplicationResources key=ApplicationResources null=false parameter=ApplicationResources/ plug-in className=org.apache.struts.tiles.TilesPlugin... The ApplicationResources.properties file is located at /WEB-INF/classes/ApplicationResources.properties it contains: - 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]
RE: Html:messages vs html:errors
Hooray, I found it, thanks to Allen and Niall. logic:messagesPresent message=true h3font color=redMessages:/font/h3 ul html:messages id=msg message=true libean:write name=msg //li /html:messages /ul /logic:messagesPresent Since it was finding messages present when it should, but wasn't finding the messages themselves, it should have dawned on me that if logic:messagesPresent needs to know if you are looking for message=true so then the html:messages might need message=true as well. So back to the grindstone, thanks again. Michael Oliver CTO Alarius Systems LLC 3325 N. Nellis Blvd, #1 Las Vegas, NV 89115 Phone:(702)643-7425 Fax:(702)974-0341 *Note new email changed from [EMAIL PROTECTED] -Original Message- From: Fogleson, Allen [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 12:25 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Html:messages vs html:errors Michael, Are you capturing exceptions in the jsp? (i.e. do you wrap a giant try catch block or something?) I ask this because it must be finding the message since if a key is not found you should get an exception along the lines of Cannot find message resource for key (I cant remember the exact text) and sorry I cant see your entire text. Can you forward the applicationResources file and the jsp bean:message call to me? You could turn your logging to debug for org.apache.struts.util and that may help you some also. Al -Original Message- From: Michael Oliver [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 2:14 PM To: 'Struts Users Mailing List' Subject: RE: Html:messages vs html:errors Thanks, But ARG That wasn't it. I changed the message-resources tag as you suggest, message-resources null=false parameter=ApplicationResources/ however I am still not displaying any messages not even the ???null??? there are also no exceptions in the log. Is there some other package I can add a logger for that might yield a hint as to what's going on? Michael Oliver CTO Alarius Systems LLC 3325 N. Nellis Blvd, #1 Las Vegas, NV 89115 Phone:(702)643-7425 Fax:(702)974-0341 *Note new email changed from [EMAIL PROTECTED] -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 11:30 AM To: Struts Users Mailing List Subject: Re: Html:messages vs html:errors The problem is with how you've configured your messages resources. Because you've specified a key your message resources are not being stored under the default messages resources key. There being stored under the bundle key ApplicationResources. You just need to remove that (and the id, its unnecessary) and have the following... message-resources null=false parameter=ApplicationResources/ If you do specify a key value in the message-resources element, then you need to use the same value in the bundle attribute of the JSP tags, something like the following should work with what you had set up... bean:message key=myMessage.key bundle=ApplicationResources / I'm going to post an update to the page I originally put up which includes info on this - I'll post to the list when its ready. Niall - Original Message - From: Michael Oliver [EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 5:12 PM Still not displaying messages, here is what I have so far. struts-config.xml entry: snip ...controller/ message-resources id=ApplicationResources key=ApplicationResources null=false parameter=ApplicationResources/ plug-in className=org.apache.struts.tiles.TilesPlugin... The ApplicationResources.properties file is located at /WEB-INF/classes/ApplicationResources.properties it contains: - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Html:messages vs html:errors
Hi, I'm a Struts newbie. A lot of the books and documentation I have on Struts is pre 1.2 and uses html:errors and ActionErrors. Given ActionErrors is deprecated, I'd like to use ActionMessages for some new JSPs I'm writing. Does anyone know of links to more up-to-date articles or documentation discussing the transition from Errors to Messages, what's similar and what has changed ? I've looked at the Apache website, but it mostly still seems to talk in terms of ActionErrors. TIA, Fergal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Html:messages vs html:errors
I'm a Struts newbie. A lot of the books and documentation I have on Struts is pre 1.2 and uses html:errors and ActionErrors. Given ActionErrors is deprecated, I'd like to use ActionMessages for some new JSPs I'm writing. the usage is the same. actionerrors are dependent on certain keys such as error.prefix that came with the messageresources file. messageresources have no such dependencies. have a look at the struts-examples.war. u'll see all u'll need there :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Html:messages vs html:errors
Here are wiki topics that discuss this: http://wiki.apache.org/struts/StrutsDeprecatedActionErrors http://wiki.apache.org/struts/ActionErrorsAndActionMessages Hubert On Apr 5, 2005 8:18 AM, Fergal O'Shea [EMAIL PROTECTED] wrote: Hi, I'm a Struts newbie. A lot of the books and documentation I have on Struts is pre 1.2 and uses html:errors and ActionErrors. Given ActionErrors is deprecated, I'd like to use ActionMessages for some new JSPs I'm writing. Does anyone know of links to more up-to-date articles or documentation discussing the transition from Errors to Messages, what's similar and what has changed ? I've looked at the Apache website, but it mostly still seems to talk in terms of ActionErrors. TIA, Fergal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Html:messages vs html:errors
We don't seem to have struts-examples.war readily available here at work. Does anyone have an example of overriding an ActionForm's validate() method, but using ActionMessage instead of ActionError (I presume you still have to use a Collection of ActionErrors), and using html:messages instead of simple old html:errors/. Specifically, how does one tie in the id parameter in html:messages with the ActionErrors Collection returned by one's validate() method ? I'm a Struts newbie. A lot of the books and documentation I have on Struts is pre 1.2 and uses html:errors and ActionErrors. Given ActionErrors is deprecated, I'd like to use ActionMessages for some new JSPs I'm writing. the usage is the same. actionerrors are dependent on certain keys such as error.prefix that came with the messageresources file. messageresources have no such dependencies. have a look at the struts-examples.war. u'll see all u'll need there :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Html:messages vs html:errors
From this and other messages I think you've got the wrong end of the stick regarding the html:errors tag. You can use either html:errors or html:messages with ActionMessage, its just down to personal preference. I've added a page comparing html:errors and html:messages here: http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html You can use either As for the validate method in your action form - then whether you use html:errors or html:messages the you can do something like the following... public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if (some conditon here) { errors.add(myProperty, new ActionMessage(myProperty.error)); } return errors; } Niall - Original Message - From: Fergal O'Shea [EMAIL PROTECTED] To: 'Riyaz Mansoor' [EMAIL PROTECTED]; 'Struts Users Mailing List' user@struts.apache.org Sent: Tuesday, April 05, 2005 5:21 PM Subject: RE: Html:messages vs html:errors We don't seem to have struts-examples.war readily available here at work. Does anyone have an example of overriding an ActionForm's validate() method, but using ActionMessage instead of ActionError (I presume you still have to use a Collection of ActionErrors), and using html:messages instead of simple old html:errors/. Specifically, how does one tie in the id parameter in html:messages with the ActionErrors Collection returned by one's validate() method ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Html:messages vs html:errors
This seems to be one of the biggest problems for Struts users, I am still on 1.1 but had so much trouble with html:errors/ that I am sure moving to html:messages will be better, I too want to do that, but not finding what to do. Michael Oliver CTO Alarius Systems LLC 3325 N. Nellis Blvd, #1 Las Vegas, NV 89115 Phone:(702)643-7425 Fax:(702)974-0341 *Note new email changed from [EMAIL PROTECTED] -Original Message- From: Fergal O'Shea [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 05, 2005 9:22 AM To: 'Riyaz Mansoor'; 'Struts Users Mailing List' Subject: RE: Html:messages vs html:errors We don't seem to have struts-examples.war readily available here at work. Does anyone have an example of overriding an ActionForm's validate() method, but using ActionMessage instead of ActionError (I presume you still have to use a Collection of ActionErrors), and using html:messages instead of simple old html:errors/. Specifically, how does one tie in the id parameter in html:messages with the ActionErrors Collection returned by one's validate() method ? I'm a Struts newbie. A lot of the books and documentation I have on Struts is pre 1.2 and uses html:errors and ActionErrors. Given ActionErrors is deprecated, I'd like to use ActionMessages for some new JSPs I'm writing. the usage is the same. actionerrors are dependent on certain keys such as error.prefix that came with the messageresources file. messageresources have no such dependencies. have a look at the struts-examples.war. u'll see all u'll need there :) - 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: Html:messages vs html:errors
I tried the example from the HelpTagsErrorsAndMessages.html in my jsp near the top of the body. logic:messagesPresent h3font color=red/fontMessages:/h3 ul html:messages id=msg libean:write name=msg //li /html:messages /ul /logic:messagesPresent The action that forwards to that jsp has: ActionErrors errors = new ActionErrors(); errors.add(ActionErrors.GLOBAL_MESSAGE, new ActionMessage(error.detail,retStatus)); this.saveErrors(request, errors); where retStatus is a string. And in my ApplicationResources.properties I have error.detail={0} But when I run it I get org.apache.jasper.JasperException: Cannot find bean msg in any scope ... - Root Cause - javax.servlet.ServletException: Cannot find bean msg in any scope ... Michael Oliver CTO Alarius Systems LLC 3325 N. Nellis Blvd, #1 Las Vegas, NV 89115 Phone:(702)643-7425 Fax:(702)974-0341 *Note new email changed from [EMAIL PROTECTED] -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 05, 2005 12:28 PM To: Struts Users Mailing List Subject: Re: Html:messages vs html:errors From this and other messages I think you've got the wrong end of the stick regarding the html:errors tag. You can use either html:errors or html:messages with ActionMessage, its just down to personal preference. I've added a page comparing html:errors and html:messages here: http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html You can use either As for the validate method in your action form - then whether you use html:errors or html:messages the you can do something like the following... public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if (some conditon here) { errors.add(myProperty, new ActionMessage(myProperty.error)); } return errors; } Niall - Original Message - From: Fergal O'Shea [EMAIL PROTECTED] To: 'Riyaz Mansoor' [EMAIL PROTECTED]; 'Struts Users Mailing List' user@struts.apache.org Sent: Tuesday, April 05, 2005 5:21 PM Subject: RE: Html:messages vs html:errors We don't seem to have struts-examples.war readily available here at work. Does anyone have an example of overriding an ActionForm's validate() method, but using ActionMessage instead of ActionError (I presume you still have to use a Collection of ActionErrors), and using html:messages instead of simple old html:errors/. Specifically, how does one tie in the id parameter in html:messages with the ActionErrors Collection returned by one's validate() method ? - 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: Html:messages vs html:errors
One cause of this is if it can't find the message key in your application resources and you have your message resources configured with null=true. If you change your message resources config to null=false in your struts-config.xml message-resources null=false parameter=myPackage.ApplicationResources/ Then if it can't find the message for some reason, you should get the following displayed. h3font color=red/fontMessages:/h3 ul li ???en_US.error.detail/li /ul Another cause...do you have the taglib declaration for the html tags at the top of your page? Anyway, what you have looks good, just a matter of debugging which bits of struts are not configured properly. Nialll - Original Message - From: Michael Oliver [EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 12:25 AM I tried the example from the HelpTagsErrorsAndMessages.html in my jsp near the top of the body. logic:messagesPresent h3font color=red/fontMessages:/h3 ul html:messages id=msg libean:write name=msg //li /html:messages /ul /logic:messagesPresent The action that forwards to that jsp has: ActionErrors errors = new ActionErrors(); errors.add(ActionErrors.GLOBAL_MESSAGE, new ActionMessage(error.detail,retStatus)); this.saveErrors(request, errors); where retStatus is a string. And in my ApplicationResources.properties I have error.detail={0} But when I run it I get org.apache.jasper.JasperException: Cannot find bean msg in any scope ... - Root Cause - javax.servlet.ServletException: Cannot find bean msg in any scope - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:messages with multiple bundles?
hihi, has anyone a good way to handle displaying multiple messages that come from multiple bundles (resource files) on the jsp? how can i make my jsp handle messages that can come from more than one bundle? the reason why i need to do this is because we made a base application that all projects will include. this base application contains generic functionality that all future projects will inherit. so it has it's own bundles of messages, that has now come into the situation where it's possible that the returned ActionMessages or ActionErrors collection contains ActionMessage or ActionError objects with keys coming from the base bundles and the project bundles. ie. it is not guaranteed that all message collection keys will come from one bundle. any suggestions on how to handle this is greatly appreciated as always. please and thanks, woodchuck ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:messages with multiple bundles?
A simple solution would be to change your build process to combine the base properties and the applications properties into one resource file. Paul -Original Message- From: Woodchuck [mailto:[EMAIL PROTECTED] Sent: Thursday, September 30, 2004 2:23 PM To: struts Subject: html:messages with multiple bundles? hihi, has anyone a good way to handle displaying multiple messages that come from multiple bundles (resource files) on the jsp? how can i make my jsp handle messages that can come from more than one bundle? the reason why i need to do this is because we made a base application that all projects will include. this base application contains generic functionality that all future projects will inherit. so it has it's own bundles of messages, that has now come into the situation where it's possible that the returned ActionMessages or ActionErrors collection contains ActionMessage or ActionError objects with keys coming from the base bundles and the project bundles. ie. it is not guaranteed that all message collection keys will come from one bundle. any suggestions on how to handle this is greatly appreciated as always. please and thanks, woodchuck ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:messages with multiple bundles?
There are outstanding enhacement requests for this kind of feature: http://issues.apache.org/bugzilla/show_bug.cgi?id=7892 http://issues.apache.org/bugzilla/show_bug.cgi?id=30401 Niall - Original Message - From: Woodchuck [EMAIL PROTECTED] To: struts [EMAIL PROTECTED] Sent: Thursday, September 30, 2004 2:23 PM Subject: html:messages with multiple bundles? hihi, has anyone a good way to handle displaying multiple messages that come from multiple bundles (resource files) on the jsp? how can i make my jsp handle messages that can come from more than one bundle? the reason why i need to do this is because we made a base application that all projects will include. this base application contains generic functionality that all future projects will inherit. so it has it's own bundles of messages, that has now come into the situation where it's possible that the returned ActionMessages or ActionErrors collection contains ActionMessage or ActionError objects with keys coming from the base bundles and the project bundles. ie. it is not guaranteed that all message collection keys will come from one bundle. any suggestions on how to handle this is greatly appreciated as always. please and thanks, woodchuck ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com - 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: Indentation using html:messages tag
So you are looking for something like this First Name Required Max Length Last Name Required Hard to help unless we know what you are looking for? Nathan On Jul 30, 2004, at 3:08 AM, Suresh S wrote: Hi, OK, i got what you r trying to say .But the problem is the errors in the list are need to be displayed from the bundle whereas the Title is user entered . Thanx Suresh S On Fri, 2004-07-30 at 14:24, Suresh S wrote: Hi , Thanks for the quick reply.But still i will be having problem in identifying which is Title and Error. i need to achieve something like this Title 1 * error1 * error 2 Title 2 * error1 * error2 Title n * error1 * error2 Thanx Suresh S On Fri, 2004-07-30 at 13:27, Erdem Ergin wrote: hi; While you are generating your action messages you can use a format which is specified in your message resource file. Simple usage: ... msg = new ActionMessage(your key in message resources file, stop); messages.add(message2, msg) ... and in jsp use: html:messages id=msg message=true bean:write name=msg/br /html:messages which writes all the messages Detailed example can be found at: http://javaboutique.internet.com/tutorials/excep_struts/index-2.html Erdem -Original Message- From: Suresh S [mailto:[EMAIL PROTECTED] Sent: Fri 7/30/2004 10:38 AM To: Struts Users Mailing List Subject: Indentation using html:messages tag hi friends, I have a problem in displaying validation messages in using html: messages tag can some one help me on this? this is the problem i need to display the validation messages in following format. Title 1 * error1 * error 2 Title 2 * error1 * error2 Title n * error1 * error2 The problem here is all the contents are dynamic including the title name . Thanks in advance for your suggestions.Pls reply asap Thanx Suresh S _ _ - 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]
Problem with displaying a subset of error messages using html:messages
Hi Im have been using pretty standard code to display error messages so far, eg: logic:messagesPresent html:messages id=error libean:write name=error//li /html:messages brbr /logic:messagesPresent But now, the problem I am facing is that I want to display a subset of my error messages in one part of page, (e.g. Error messages that start with Company) and the rest of the messages (ones that start with Factory) in another section of the page. I've read the docs but really havent been able to figure this one out. Can someone plese help me? Thanks. -Asif
Re: Problem with displaying a subset of error messages using html:messages
Hello Asif, Now I havn't checked what I'm going to write here but am pretty sure it should work. First of all while adding your ActionError to ActionErrors use 'company' as the key for the company errors and 'factory' for factory related error messages. like: ActionErrors errors = new ActionErrors(); errors.add('company', new ActionError()); errors.add('factory', new ActionError()); now in you loop wrap you bean:wrie in an if statement: logic:messagesPresent html:messages id=error c:if test=${error.key == 'company'} libean:write name=error//li /c:if /html:messages brbr /logic:messagesPresent hope this work and helps! ATTA - Original Message - From: Asif Rahman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 24, 2004 12:48 PM Subject: Problem with displaying a subset of error messages using html:messages Hi Im have been using pretty standard code to display error messages so far, eg: logic:messagesPresent html:messages id=error libean:write name=error//li /html:messages brbr /logic:messagesPresent But now, the problem I am facing is that I want to display a subset of my error messages in one part of page, (e.g. Error messages that start with Company) and the rest of the messages (ones that start with Factory) in another section of the page. I've read the docs but really havent been able to figure this one out. Can someone plese help me? Thanks. -Asif - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with displaying a subset of error messages using html:messages
Hi Atta, this is what I'm getting when I try that: javax.servlet.jsp.JspTagException: javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute test with value ${error.key == 'company'}: Unable to find a value for key in object of class java.lang.String using operator . (null) at org.apache.taglibs.standard.tag.el.core.IfTag.condition(IfTag.java:102) Any ideas? -Asif - Original Message - From: atta-ur rehman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED]; Asif Rahman [EMAIL PROTECTED] Sent: Thursday, June 24, 2004 4:04 PM Subject: Re: Problem with displaying a subset of error messages using html:messages Hello Asif, Now I havn't checked what I'm going to write here but am pretty sure it should work. First of all while adding your ActionError to ActionErrors use 'company' as the key for the company errors and 'factory' for factory related error messages. like: ActionErrors errors = new ActionErrors(); errors.add('company', new ActionError()); errors.add('factory', new ActionError()); now in you loop wrap you bean:wrie in an if statement: logic:messagesPresent html:messages id=error c:if test=${error.key == 'company'} libean:write name=error//li /c:if /html:messages brbr /logic:messagesPresent hope this work and helps! ATTA - Original Message - From: Asif Rahman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 24, 2004 12:48 PM Subject: Problem with displaying a subset of error messages using html:messages Hi Im have been using pretty standard code to display error messages so far, eg: logic:messagesPresent html:messages id=error libean:write name=error//li /html:messages brbr /logic:messagesPresent But now, the problem I am facing is that I want to display a subset of my error messages in one part of page, (e.g. Error messages that start with Company) and the rest of the messages (ones that start with Factory) in another section of the page. I've read the docs but really havent been able to figure this one out. Can someone plese help me? Thanks. -Asif - 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: Problem with displaying a subset of error messages using html:messages
Okay, while out for lunch i thought about it and i think the right way of doing it would be to use property attribute of the html:messages tag: http://jakarta.apache.org/struts/userGuide/struts-html.html#messages henc new code: logic:messagesPresent html:messages id=error property=company libean:write name=error//li /html:messages brbr /logic:messagesPresent I wish i could have been able to check it but let's see if it works! ATTA - Original Message - From: Asif Rahman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 24, 2004 1:26 PM Subject: Re: Problem with displaying a subset of error messages using html:messages Hi Atta, this is what I'm getting when I try that: javax.servlet.jsp.JspTagException: javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute test with value ${error.key == 'company'}: Unable to find a value for key in object of class java.lang.String using operator . (null) at org.apache.taglibs.standard.tag.el.core.IfTag.condition(IfTag.java:102) Any ideas? -Asif - Original Message - From: atta-ur rehman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED]; Asif Rahman [EMAIL PROTECTED] Sent: Thursday, June 24, 2004 4:04 PM Subject: Re: Problem with displaying a subset of error messages using html:messages Hello Asif, Now I havn't checked what I'm going to write here but am pretty sure it should work. First of all while adding your ActionError to ActionErrors use 'company' as the key for the company errors and 'factory' for factory related error messages. like: ActionErrors errors = new ActionErrors(); errors.add('company', new ActionError()); errors.add('factory', new ActionError()); now in you loop wrap you bean:wrie in an if statement: logic:messagesPresent html:messages id=error c:if test=${error.key == 'company'} libean:write name=error//li /c:if /html:messages brbr /logic:messagesPresent hope this work and helps! ATTA - Original Message - From: Asif Rahman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 24, 2004 12:48 PM Subject: Problem with displaying a subset of error messages using html:messages Hi Im have been using pretty standard code to display error messages so far, eg: logic:messagesPresent html:messages id=error libean:write name=error//li /html:messages brbr /logic:messagesPresent But now, the problem I am facing is that I want to display a subset of my error messages in one part of page, (e.g. Error messages that start with Company) and the rest of the messages (ones that start with Factory) in another section of the page. I've read the docs but really havent been able to figure this one out. Can someone plese help me? Thanks. -Asif - 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]
[SOLVED] Re: Problem with displaying a subset of error messages using html:messages
It works! I just got it to work the same way too:http://javaboutique.internet.com/tutorials/excep_struts/index-2.html Thanks so much Atta :) -Asif - Original Message - From: atta-ur rehman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED]; Asif Rahman [EMAIL PROTECTED] Sent: Thursday, June 24, 2004 4:56 PM Subject: Re: Problem with displaying a subset of error messages using html:messages Okay, while out for lunch i thought about it and i think the right way of doing it would be to use property attribute of the html:messages tag: http://jakarta.apache.org/struts/userGuide/struts-html.html#messages henc new code: logic:messagesPresent html:messages id=error property=company libean:write name=error//li /html:messages brbr /logic:messagesPresent I wish i could have been able to check it but let's see if it works! ATTA - Original Message - From: Asif Rahman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 24, 2004 1:26 PM Subject: Re: Problem with displaying a subset of error messages using html:messages Hi Atta, this is what I'm getting when I try that: javax.servlet.jsp.JspTagException: javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute test with value ${error.key == 'company'}: Unable to find a value for key in object of class java.lang.String using operator . (null) at org.apache.taglibs.standard.tag.el.core.IfTag.condition(IfTag.java:102) Any ideas? -Asif - Original Message - From: atta-ur rehman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED]; Asif Rahman [EMAIL PROTECTED] Sent: Thursday, June 24, 2004 4:04 PM Subject: Re: Problem with displaying a subset of error messages using html:messages Hello Asif, Now I havn't checked what I'm going to write here but am pretty sure it should work. First of all while adding your ActionError to ActionErrors use 'company' as the key for the company errors and 'factory' for factory related error messages. like: ActionErrors errors = new ActionErrors(); errors.add('company', new ActionError()); errors.add('factory', new ActionError()); now in you loop wrap you bean:wrie in an if statement: logic:messagesPresent html:messages id=error c:if test=${error.key == 'company'} libean:write name=error//li /c:if /html:messages brbr /logic:messagesPresent hope this work and helps! ATTA - Original Message - From: Asif Rahman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 24, 2004 12:48 PM Subject: Problem with displaying a subset of error messages using html:messages Hi Im have been using pretty standard code to display error messages so far, eg: logic:messagesPresent html:messages id=error libean:write name=error//li /html:messages brbr /logic:messagesPresent But now, the problem I am facing is that I want to display a subset of my error messages in one part of page, (e.g. Error messages that start with Company) and the rest of the messages (ones that start with Factory) in another section of the page. I've read the docs but really havent been able to figure this one out. Can someone plese help me? Thanks. -Asif - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Html:messages tag
Hi All, I seem not to be able to get html:message print out the message I set up in the action at all. I have looked at the request attribute, it does contain the ActionMessages and I was able to retrieve the message for a particular property in my JSP, but the tag just doesn't work. Here is the code snipplet in my jsp logic:messagesPresent message=true Msg=html:messages id=msg message=true property=x / /logic:messagesPresent The output is always Msg= Any idea? Thanks -Betty -Original Message- From: Ram Venkataswamy [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:50 PM To: Struts Users Mailing List Subject: RE: getInputForward() question Yep, your colleague is right - input attribute is used to re-direct the control if validation fails - not for Success / user defined forwards V.K.Ram NitroX Struts Team -Original Message- From: Carl Fyffe [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:36 PM To: [EMAIL PROTECTED] Subject: getInputForward() question For the past year or so, I have been using getInputForward() and the input attribute in the action to define the default end point for that action. I did that because normally there is only one tile for the action to go to, so being lazy I wouldn't create a forward I would just use the input to act as the default forward. Today a colleague informed me that was a poor strategy because the input is only for when validation fails. Am I missusing the input attribute? Carl - 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]
Re: Html:messages tag
Have you tried removing property from the messages tag to see if the message you're wanting to print out exists in the collection at all ? Hope this helps! Chris - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 8:19 PM Subject: Html:messages tag Hi All, I seem not to be able to get html:message print out the message I set up in the action at all. I have looked at the request attribute, it does contain the ActionMessages and I was able to retrieve the message for a particular property in my JSP, but the tag just doesn't work. Here is the code snipplet in my jsp logic:messagesPresent message=true Msg=html:messages id=msg message=true property=x / /logic:messagesPresent The output is always Msg= Any idea? Thanks -Betty -Original Message- From: Ram Venkataswamy [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:50 PM To: Struts Users Mailing List Subject: RE: getInputForward() question Yep, your colleague is right - input attribute is used to re-direct the control if validation fails - not for Success / user defined forwards V.K.Ram NitroX Struts Team -Original Message- From: Carl Fyffe [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:36 PM To: [EMAIL PROTECTED] Subject: getInputForward() question For the past year or so, I have been using getInputForward() and the input attribute in the action to define the default end point for that action. I did that because normally there is only one tile for the action to go to, so being lazy I wouldn't create a forward I would just use the input to act as the default forward. Today a colleague informed me that was a poor strategy because the input is only for when validation fails. Am I missusing the input attribute? Carl - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Html:messages tag
I did, it doesn't help. Nothing get printed out at all. -Betty -Original Message- From: Chris Cranford [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 5:27 PM To: Struts Users Mailing List Subject: Re: Html:messages tag Have you tried removing property from the messages tag to see if the message you're wanting to print out exists in the collection at all ? Hope this helps! Chris - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 8:19 PM Subject: Html:messages tag Hi All, I seem not to be able to get html:message print out the message I set up in the action at all. I have looked at the request attribute, it does contain the ActionMessages and I was able to retrieve the message for a particular property in my JSP, but the tag just doesn't work. Here is the code snipplet in my jsp logic:messagesPresent message=true Msg=html:messages id=msg message=true property=x / /logic:messagesPresent The output is always Msg= Any idea? Thanks -Betty -Original Message- From: Ram Venkataswamy [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:50 PM To: Struts Users Mailing List Subject: RE: getInputForward() question Yep, your colleague is right - input attribute is used to re-direct the control if validation fails - not for Success / user defined forwards V.K.Ram NitroX Struts Team -Original Message- From: Carl Fyffe [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:36 PM To: [EMAIL PROTECTED] Subject: getInputForward() question For the past year or so, I have been using getInputForward() and the input attribute in the action to define the default end point for that action. I did that because normally there is only one tile for the action to go to, so being lazy I wouldn't create a forward I would just use the input to act as the default forward. Today a colleague informed me that was a poor strategy because the input is only for when validation fails. Am I missusing the input attribute? Carl - 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] - 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: Html:messages tag
How are you creating the message inside your action? Can you post that code snippet? - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 8:30 PM Subject: RE: Html:messages tag I did, it doesn't help. Nothing get printed out at all. -Betty -Original Message- From: Chris Cranford [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 5:27 PM To: Struts Users Mailing List Subject: Re: Html:messages tag Have you tried removing property from the messages tag to see if the message you're wanting to print out exists in the collection at all ? Hope this helps! Chris - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 8:19 PM Subject: Html:messages tag Hi All, I seem not to be able to get html:message print out the message I set up in the action at all. I have looked at the request attribute, it does contain the ActionMessages and I was able to retrieve the message for a particular property in my JSP, but the tag just doesn't work. Here is the code snipplet in my jsp logic:messagesPresent message=true Msg=html:messages id=msg message=true property=x / /logic:messagesPresent The output is always Msg= Any idea? Thanks -Betty -Original Message- From: Ram Venkataswamy [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:50 PM To: Struts Users Mailing List Subject: RE: getInputForward() question Yep, your colleague is right - input attribute is used to re-direct the control if validation fails - not for Success / user defined forwards V.K.Ram NitroX Struts Team -Original Message- From: Carl Fyffe [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:36 PM To: [EMAIL PROTECTED] Subject: getInputForward() question For the past year or so, I have been using getInputForward() and the input attribute in the action to define the default end point for that action. I did that because normally there is only one tile for the action to go to, so being lazy I wouldn't create a forward I would just use the input to act as the default forward. Today a colleague informed me that was a poor strategy because the input is only for when validation fails. Am I missusing the input attribute? Carl - 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] - 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]
RE: Html:messages tag (Resolved)
I didn't know I have to do the following: logic:messagesPresent message=true html:messages id=msg message=true property=x / Msg=bean:write name=msg / /logic:messagesPresent -Betty -Original Message- From: Betty Koon [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 5:31 PM To: 'Struts Users Mailing List' Subject: RE: Html:messages tag I did, it doesn't help. Nothing get printed out at all. -Betty -Original Message- From: Chris Cranford [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 5:27 PM To: Struts Users Mailing List Subject: Re: Html:messages tag Have you tried removing property from the messages tag to see if the message you're wanting to print out exists in the collection at all ? Hope this helps! Chris - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 8:19 PM Subject: Html:messages tag Hi All, I seem not to be able to get html:message print out the message I set up in the action at all. I have looked at the request attribute, it does contain the ActionMessages and I was able to retrieve the message for a particular property in my JSP, but the tag just doesn't work. Here is the code snipplet in my jsp logic:messagesPresent message=true Msg=html:messages id=msg message=true property=x / /logic:messagesPresent The output is always Msg= Any idea? Thanks -Betty -Original Message- From: Ram Venkataswamy [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:50 PM To: Struts Users Mailing List Subject: RE: getInputForward() question Yep, your colleague is right - input attribute is used to re-direct the control if validation fails - not for Success / user defined forwards V.K.Ram NitroX Struts Team -Original Message- From: Carl Fyffe [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:36 PM To: [EMAIL PROTECTED] Subject: getInputForward() question For the past year or so, I have been using getInputForward() and the input attribute in the action to define the default end point for that action. I did that because normally there is only one tile for the action to go to, so being lazy I wouldn't create a forward I would just use the input to act as the default forward. Today a colleague informed me that was a poor strategy because the input is only for when validation fails. Am I missusing the input attribute? Carl - 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] - 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]
Re: Html:messages tag (Resolved)
Yup :-) ... that is correct ... :-) - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 8:33 PM Subject: RE: Html:messages tag (Resolved) I didn't know I have to do the following: logic:messagesPresent message=true html:messages id=msg message=true property=x / Msg=bean:write name=msg / /logic:messagesPresent -Betty -Original Message- From: Betty Koon [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 5:31 PM To: 'Struts Users Mailing List' Subject: RE: Html:messages tag I did, it doesn't help. Nothing get printed out at all. -Betty -Original Message- From: Chris Cranford [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 5:27 PM To: Struts Users Mailing List Subject: Re: Html:messages tag Have you tried removing property from the messages tag to see if the message you're wanting to print out exists in the collection at all ? Hope this helps! Chris - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 8:19 PM Subject: Html:messages tag Hi All, I seem not to be able to get html:message print out the message I set up in the action at all. I have looked at the request attribute, it does contain the ActionMessages and I was able to retrieve the message for a particular property in my JSP, but the tag just doesn't work. Here is the code snipplet in my jsp logic:messagesPresent message=true Msg=html:messages id=msg message=true property=x / /logic:messagesPresent The output is always Msg= Any idea? Thanks -Betty -Original Message- From: Ram Venkataswamy [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:50 PM To: Struts Users Mailing List Subject: RE: getInputForward() question Yep, your colleague is right - input attribute is used to re-direct the control if validation fails - not for Success / user defined forwards V.K.Ram NitroX Struts Team -Original Message- From: Carl Fyffe [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:36 PM To: [EMAIL PROTECTED] Subject: getInputForward() question For the past year or so, I have been using getInputForward() and the input attribute in the action to define the default end point for that action. I did that because normally there is only one tile for the action to go to, so being lazy I wouldn't create a forward I would just use the input to act as the default forward. Today a colleague informed me that was a poor strategy because the input is only for when validation fails. Am I missusing the input attribute? Carl - 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] - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Html:messages tag (Resolved)
This isn't the correct way to use html:messages. It iterates over either all the messages (if you don't specify a property) or all messages for a property storing each message as a page scope variable. The way your using it it will only display the last message (try putting two messages for property x) - you should really have a closing /html:messages tag: html:messages id=msg message=true property=x Msg=bean:write name=msg / /html:messages Also if you do it this way there's no need for the logic:messagesPresent tag, unless you want to display some other markup around your errors, such as logic:messagesPresent message=true The following errors have occured:/br ul html:messages id=msg message=true property=x liMsg=bean:write name=msg //li /html:messages /ul /logic:messagesPresent Niall - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, June 17, 2004 1:33 AM Subject: RE: Html:messages tag (Resolved) I didn't know I have to do the following: logic:messagesPresent message=true html:messages id=msg message=true property=x / Msg=bean:write name=msg / /logic:messagesPresent -Betty -Original Message- From: Betty Koon [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 5:31 PM To: 'Struts Users Mailing List' Subject: RE: Html:messages tag I did, it doesn't help. Nothing get printed out at all. -Betty -Original Message- From: Chris Cranford [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 5:27 PM To: Struts Users Mailing List Subject: Re: Html:messages tag Have you tried removing property from the messages tag to see if the message you're wanting to print out exists in the collection at all ? Hope this helps! Chris - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 8:19 PM Subject: Html:messages tag Hi All, I seem not to be able to get html:message print out the message I set up in the action at all. I have looked at the request attribute, it does contain the ActionMessages and I was able to retrieve the message for a particular property in my JSP, but the tag just doesn't work. Here is the code snipplet in my jsp logic:messagesPresent message=true Msg=html:messages id=msg message=true property=x / /logic:messagesPresent The output is always Msg= Any idea? Thanks -Betty -Original Message- From: Ram Venkataswamy [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:50 PM To: Struts Users Mailing List Subject: RE: getInputForward() question Yep, your colleague is right - input attribute is used to re-direct the control if validation fails - not for Success / user defined forwards V.K.Ram NitroX Struts Team -Original Message- From: Carl Fyffe [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:36 PM To: [EMAIL PROTECTED] Subject: getInputForward() question For the past year or so, I have been using getInputForward() and the input attribute in the action to define the default end point for that action. I did that because normally there is only one tile for the action to go to, so being lazy I wouldn't create a forward I would just use the input to act as the default forward. Today a colleague informed me that was a poor strategy because the input is only for when validation fails. Am I missusing the input attribute? Carl - 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] - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Html:messages tag (Resolved)
I am sorry but I am not clear on what suggestion? Can you elaborate your suggestion in code snippnet. Thanks. In my case, I am sure, I will only have 1 message set up for property x. -Betty -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 7:18 PM To: Struts Users Mailing List Subject: Re: Html:messages tag (Resolved) This isn't the correct way to use html:messages. It iterates over either all the messages (if you don't specify a property) or all messages for a property storing each message as a page scope variable. The way your using it it will only display the last message (try putting two messages for property x) - you should really have a closing /html:messages tag: html:messages id=msg message=true property=x Msg=bean:write name=msg / /html:messages Also if you do it this way there's no need for the logic:messagesPresent tag, unless you want to display some other markup around your errors, such as logic:messagesPresent message=true The following errors have occured:/br ul html:messages id=msg message=true property=x liMsg=bean:write name=msg //li /html:messages /ul /logic:messagesPresent Niall - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, June 17, 2004 1:33 AM Subject: RE: Html:messages tag (Resolved) I didn't know I have to do the following: logic:messagesPresent message=true html:messages id=msg message=true property=x / Msg=bean:write name=msg / /logic:messagesPresent -Betty -Original Message- From: Betty Koon [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 5:31 PM To: 'Struts Users Mailing List' Subject: RE: Html:messages tag I did, it doesn't help. Nothing get printed out at all. -Betty -Original Message- From: Chris Cranford [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 5:27 PM To: Struts Users Mailing List Subject: Re: Html:messages tag Have you tried removing property from the messages tag to see if the message you're wanting to print out exists in the collection at all ? Hope this helps! Chris - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 8:19 PM Subject: Html:messages tag Hi All, I seem not to be able to get html:message print out the message I set up in the action at all. I have looked at the request attribute, it does contain the ActionMessages and I was able to retrieve the message for a particular property in my JSP, but the tag just doesn't work. Here is the code snipplet in my jsp logic:messagesPresent message=true Msg=html:messages id=msg message=true property=x / /logic:messagesPresent The output is always Msg= Any idea? Thanks -Betty -Original Message- From: Ram Venkataswamy [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:50 PM To: Struts Users Mailing List Subject: RE: getInputForward() question Yep, your colleague is right - input attribute is used to re-direct the control if validation fails - not for Success / user defined forwards V.K.Ram NitroX Struts Team -Original Message- From: Carl Fyffe [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:36 PM To: [EMAIL PROTECTED] Subject: getInputForward() question For the past year or so, I have been using getInputForward() and the input attribute in the action to define the default end point for that action. I did that because normally there is only one tile for the action to go to, so being lazy I wouldn't create a forward I would just use the input to act as the default forward. Today a colleague informed me that was a poor strategy because the input is only for when validation fails. Am I missusing the input attribute? Carl - 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] - 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
Re: Html:messages tag (Resolved)
I did elaborate in a code snippets. The html:messages tag is designed to have a body, and process it iteratively - in your example it will iterate over all messages with a property x processing the body of the tag for each message it finds. The reason your code works is by accident - it stores each message under the page scope variable you specify - it just so happens that after its finished processing its body the last one still exists - making your code work (sort of) - but if you removed the logic:messagesPresent tage you would end up with Msg= being displayed when there were no messages. In your code the html:messages tag has no body - in mine id does My suggesstion was that you should replace logic:messagesPresent message=true html:messages id=msg message=true property=x / Msg=bean:write name=msg / /logic:messagesPresent With the following. html:messages id=msg message=true property=x Msg=bean:write name=msg / /html:messages Niall - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, June 17, 2004 3:19 AM Subject: RE: Html:messages tag (Resolved) I am sorry but I am not clear on what suggestion? Can you elaborate your suggestion in code snippnet. Thanks. In my case, I am sure, I will only have 1 message set up for property x. -Betty -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 7:18 PM To: Struts Users Mailing List Subject: Re: Html:messages tag (Resolved) This isn't the correct way to use html:messages. It iterates over either all the messages (if you don't specify a property) or all messages for a property storing each message as a page scope variable. The way your using it it will only display the last message (try putting two messages for property x) - you should really have a closing /html:messages tag: html:messages id=msg message=true property=x Msg=bean:write name=msg / /html:messages Also if you do it this way there's no need for the logic:messagesPresent tag, unless you want to display some other markup around your errors, such as logic:messagesPresent message=true The following errors have occured:/br ul html:messages id=msg message=true property=x liMsg=bean:write name=msg //li /html:messages /ul /logic:messagesPresent Niall - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, June 17, 2004 1:33 AM Subject: RE: Html:messages tag (Resolved) I didn't know I have to do the following: logic:messagesPresent message=true html:messages id=msg message=true property=x / Msg=bean:write name=msg / /logic:messagesPresent -Betty -Original Message- From: Betty Koon [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 5:31 PM To: 'Struts Users Mailing List' Subject: RE: Html:messages tag I did, it doesn't help. Nothing get printed out at all. -Betty -Original Message- From: Chris Cranford [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 5:27 PM To: Struts Users Mailing List Subject: Re: Html:messages tag Have you tried removing property from the messages tag to see if the message you're wanting to print out exists in the collection at all ? Hope this helps! Chris - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 8:19 PM Subject: Html:messages tag Hi All, I seem not to be able to get html:message print out the message I set up in the action at all. I have looked at the request attribute, it does contain the ActionMessages and I was able to retrieve the message for a particular property in my JSP, but the tag just doesn't work. Here is the code snipplet in my jsp logic:messagesPresent message=true Msg=html:messages id=msg message=true property=x / /logic:messagesPresent The output is always Msg= Any idea? Thanks -Betty -Original Message- From: Ram Venkataswamy [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:50 PM To: Struts Users Mailing List Subject: RE: getInputForward() question Yep, your colleague is right - input attribute is used to re-direct the control if validation fails - not for Success / user defined forwards V.K.Ram NitroX Struts Team -Original Message- From: Carl Fyffe [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 4:36 PM To: [EMAIL PROTECTED] Subject: getInputForward() question For the past year or so, I have been using getInputForward() and the input attribute in the action to define the default end point for that action. I did that because normally
html:messages ..bean:write not displaying.urgent
Hi Friends! i'm using tiles where i want to get html:errors from properties file. But i'm not getting. i'm adding and saving errors in action class only.And errors are not specific to any property but those are global using GLOBAL_MESSAGE. i'm sure that messages are available in properties file. Please anybody tell me how to make settings in tiles layout. awaiting ur reply Ganesh - Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs