Re: How can I combine a result (tiles + xslt)?
2008/3/12, Griffith, Michael * [EMAIL PROTECTED]: if( getFlush() ){ LOG.debug(Flushing output stream); out.close(); // ...and flush... } Yup you're right! Please open a JIRA issue: https://issues.apache.org/struts/browse/WW In fact the code in the trunk does not verify if flush flag is on, and this code is a bit obscure to me: http://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java Why does it take *twice* the response's writer, and closes and flushes it? If you can, please post a patch to the issue that you will create. Ciao Antonio
Re: How can I combine a result (tiles + xslt)?
2008/3/13, Antonio Petrelli [EMAIL PROTECTED]: 2008/3/12, Griffith, Michael * [EMAIL PROTECTED]: if( getFlush() ){ LOG.debug(Flushing output stream); out.close(); // ...and flush... } Yup you're right! Please open a JIRA issue: https://issues.apache.org/struts/browse/WW There's no need for it, Micheal. Martin Gainty already opened it: https://issues.apache.org/struts/browse/WW-2551 Antonio
Problem accessing GET parameter in Struts2
Hi, I am new to Struts and new to this list. I want to create a blog with struts as a university project and have been wrestling with this (obscenely) simple problem for two days without any progress. Maybe any of you struts experts may help out here: All I want to do is access a GET parameter from an action to initialize an article object. This is how my URL looks like: http://localhost:8080/struts_blog/artikel.action?artnr=1 In my struts.xml I specified an action that is correctly mapped to my action class: action name=artikel method=input class=action.ArtikelAction result name=success type=redirectActionadmin/result result name=input/WEB-INF/jsp/artikelForm.jsp/result /action My action class (ArtikelAction.java) contains the property private Integer artnr with the appropriate Getters and Setters. From what I read in the documentation and saw in the examples, this should be sufficient for the params interceptor to initialize the variable. However, this is not the case :-( What am I missing? I tried to get some debug information from the params interceptor and put the following code into my struts.xml (inside the action): interceptor-ref name=params param name=logEnabledtrue/param param name=logLevelDEBUG/param /interceptor-ref However, this just gave me the following exception when starting my project: 13.03.2008 09:18:42 com.opensymphony.xwork2.util.OgnlUtil internalSetProperty WARNUNG: Caught OgnlException while setting property 'logLevel' on type 'com.opensymphony.xwork2.interceptor.ParametersInterceptor'. ognl.NoSuchPropertyException: com.opensymphony.xwork2.interceptor.ParametersInterceptor.logLevel So, how could I debug the params interceptor? I am using the latest struts-2.0.11.1 release libraries and have set devMode to true in struts.xml. Thanks for your help. Christoph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts wml
Sean Chen wrote: Dear all, The latest struts wml tag library I found is struts-wml 1.1. Does anyone know what I can work with wml tag with struts 1.3.x? Thank you Sean Since I'd never heard of struts-wml I googled, and found the SourceForge project page for it. It doesn't look like it's been active since 2003... Your best bet would probably be to grab the source code and port it to Struts 1.3 yourself. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to use the 'struts 1 plugin' in struts2
Hi I'm Trying to use ActionForm and Action class in my struts2. I Used the struts 1 plugin for this. I followed the procedure, which they given. Still i'm finding error in this. I'm giving my entire application here. strutslogin.jsp --- %@ taglib prefix=s uri=/struts-tags % %@ page language=java contentType=text/html% html head titleInsert Data here!/title link href=s:url value=/css/main.css/ rel=stylesheet type=text/css/ /head body s:form action=/struts1/logon.action method=POST name=form1 s:textfield name=userId label=Login Id/br s:password name=password label=Password/br s:submit value=Login align=center/ /s:form /body /html MyForm.java package com; import org.apache.struts.action.ActionForm; public class MyForm extends ActionForm{ public String userId; public String password; public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } } --- MyAction.java - package com; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; public class MyAction extends Action{ public ActionForward execute( ActionMapping mapping,ActionForm form,HttpServletRequest req,HttpServletResponse res) { System.out.println(I'm in Struts 1 Action ); MyForm form1=(MyForm)form; System.out.println(form1.getUserId()); return mapping.findForward(success); } } --- struts.xml package name=udaykumar namespace=/html2 extends=struts-default action name=login result/pages/strutslogin.jsp/result /action /package package name=struts namespace=/struts1 extends=struts1-default action name=logon class=org.apache.struts2.s1.Struts1Action interceptor-ref name=scopedModelDriven com.MyForm form1 session /interceptor-ref interceptor-ref name=struts1-default/ com.MyAction result name=success/pages/strutsResult.jsp/result /action /package Please provide me the solution. Give me a example for this. -- View this message in context: http://www.nabble.com/How-to-use-the-%27struts-1-plugin%27-in-struts2-tp16024545p16024545.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Parameters: Invalid chunk ignored (parameters not passed)
Kindly help.. I have not been able to solve it yet. -- Forwarded message -- From: Rushikesh Thakkar [EMAIL PROTECTED] Date: Fri, Mar 7, 2008 at 3:40 PM Subject: Parameters: Invalid chunk ignored (parameters not passed) To: Struts Users Mailing List user@struts.apache.org I am facing a strange problem. When I use s:submit *theme=ajax targets=requestDiv* / I get the following error on the console: 07.mar.2008 15:30:46 org.apache.tomcat.util.http.ParametersprocessParameters WARNING: Parameters: Invalid chunk ignored. and the parameters are not passed properly (So, my Action fails), but after *removing* *theme=ajax targets=requestDiv*, it works fine. If I change the jsp back to s:submit theme=ajax targets=requestDiv /, then it starts working fine. Please can anybody tell me what is wrong with my application? Please help me, it is urgent.
How to implement ajax in struts 1.1
Hi friends Can any one tell me how to implement ajax in struts 1.1 with simple example.Can any one provide complete code for that. Thanks in advance Raghu Varma Bhupathiraju -- View this message in context: http://www.nabble.com/How-to-implement-ajax-in-struts-1.1-tp16024761p16024761.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 URL problem
Hi Tauri, I don't have time to try it myself right now, but what I meant was create an additional default package that contains no actions. I'm not sure if it will help though. The idea is that when the default action mapper can't match the namespace, it falls back to an empty back. Like this: package name=default namespace= extends=struts-default/package package name=register namespace=/register extends=tiles-default ...normal actions... /package ie. create an empty back in the namespace. If that doesn't work also try the / namespace. If that doesn't work, there's also some poorly documented options for the default ActionMapper. Try setting the struts property struts.mapper.alwaysSelectFullNamespace to true. It may be the one you need. Put it in struts.properties or a const in struts.xml. Hope that helps, Jeromy Evans Tauri Valor wrote: Thanks Jeromy! Ive tried creating a package with empty name space ie : package name=register namespace=/ extends=tiles-default then the following url : http://localhost:8080/MY_WEB/acc.register.RegistrationForm.do without the namespace works fine .. But any other way to keep my namespace in tact in the url because the above may not be acceptable? Thanks, Tauri http://localhost:8080/MY_WEB/register/acc.register.RegistrationForm.do Jeromy Evans - Blue Sky Minds wrote: No mistake. AFAIK that's a design flaw of the default action mapper. See: http://www.planetstruts.org/struts2-blank/example/somecrap/HelloWorld.action If there's no match in a package namespace it falls back to the default package and matches a little to generously. You may be able to avoid it by creating a package with an empty namespace containing no actions. Not sure about that one... Tauri Valor wrote: Hi I have the following problem with url in my web application: I run my app using Struts2 and Tomcat6. Context name of webapp: MY_WEB Namespace in my package tag of struts-config.xml: package name=register namespace=/register extends=tiles-default Mapping of Action class in my struts-config.xml : action name= acc.register.RegistrationForm A Href link in my jsp page: a href=register/acc.register.RegistrationForm.do Now, the following url works fine when I launch my app: http://localhost:8080/MY_WEB/register/acc.register.RegistrationForm.do But the problem is the url when added something between my packagename(register)and my uri (acc.register.RegistrationForm.do) like following: http://localhost:8080/MY_WEB/register/somecrap/acc.register.RegistrationForm.do it still works fine instead of displaying the error page. I need to get an error page if I give wrong url like the above. What is my mistake ? Pls advise. - 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 accessing GET parameter in Struts2
--- Christoph Kepper [EMAIL PROTECTED] wrote: action name=artikel method=input class=action.ArtikelAction result name=success type=redirectActionadmin/result result name=input/WEB-INF/jsp/artikelForm.jsp/result /action My action class (ArtikelAction.java) contains the property private Integer artnr with the appropriate Getters and Setters. As a sanity check, what are your getter and setters named? I tried to get some debug information from the params interceptor and put the following code into my struts.xml (inside the action): interceptor-ref name=params param name=logEnabledtrue/param param name=logLevelDEBUG/param /interceptor-ref Nate that when you use an interceptor-ref element inside an action configuration then *only* that interceptor-ref will be configured for that action: this means that in this case if this is the only interceptor-ref inside the action element then *only* the params interceptor will be run for that action. This is probably not what you want. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to use the 'struts 1 plugin' in struts2
--- udaykumar [EMAIL PROTECTED] wrote: I'm Trying to use ActionForm and Action class in my struts2. I Used the struts 1 plugin for this. I followed the procedure, which they given. Still i'm finding error in this. It would be helpful if you'd tell us *what* error(s). Just saying it doesn't work does not provide enough diagnostic information. Some of your XML didn't come through so it's also hard to tell exactly what is in your configuration file. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to implement ajax in struts 1.1
--- Raghu varma bhupathiraju [EMAIL PROTECTED] wrote: Can any one tell me how to implement ajax in struts 1.1 with simple example. Can any one provide complete code for that. ... You'd have to provide a somewhat less-nebulous requirement. There are dozens of ways to implement Ajax in Struts 1.1. I would start by (1) refining your requirement and (2) using Google or other web search engine. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts get string and is boolean
Any ideas? -Original Message- From: Peters, John Sent: Friday, March 07, 2008 10:57 PM To: 'Struts Users Mailing List' Subject: Struts get string and is boolean Is it possible to have multiple methods for the same value? Then have the jsp either load a text box or a check box For example Depending the circumstance I load setValue(boolean) or setValue(String). Then can the jsp page create either a text box or a check box? Blue Cross Blue Shield of Florida, Inc., and its subsidiary and affiliate companies are not responsible for errors or omissions in this e-mail message. Any personal comments made in this e-mail do not reflect the views of Blue Cross Blue Shield of Florida, Inc. The information contained in this document may be confidential and intended solely for the use of the individual or entity to whom it is addressed. This document may contain material that is privileged or protected from disclosure under applicable law. If you are not the intended recipient or the individual responsible for delivering to the intended recipient, please (1) be advised that any use, dissemination, forwarding, or copying of this document IS STRICTLY PROHIBITED; and (2) notify sender immediately by telephone and destroy the document. THANK YOU. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts get string and is boolean
--- Peters, John [EMAIL PROTECTED] wrote: Any ideas? I haven't seen any replies other than my own. Dave From: Peters, John Is it possible to have multiple methods for the same value? Then have the jsp either load a text box or a check box For example Depending the circumstance I load setValue(boolean) or setValue(String). Then can the jsp page create either a text box or a check box? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts get string and is boolean
Thankssorry I missed it..inbox was cluttered -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2008 9:27 AM To: Struts Users Mailing List Subject: RE: Struts get string and is boolean --- Peters, John [EMAIL PROTECTED] wrote: Any ideas? I haven't seen any replies other than my own. Dave From: Peters, John Is it possible to have multiple methods for the same value? Then have the jsp either load a text box or a check box For example Depending the circumstance I load setValue(boolean) or setValue(String). Then can the jsp page create either a text box or a check box? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Blue Cross Blue Shield of Florida, Inc., and its subsidiary and affiliate companies are not responsible for errors or omissions in this e-mail message. Any personal comments made in this e-mail do not reflect the views of Blue Cross Blue Shield of Florida, Inc. The information contained in this document may be confidential and intended solely for the use of the individual or entity to whom it is addressed. This document may contain material that is privileged or protected from disclosure under applicable law. If you are not the intended recipient or the individual responsible for delivering to the intended recipient, please (1) be advised that any use, dissemination, forwarding, or copying of this document IS STRICTLY PROHIBITED; and (2) notify sender immediately by telephone and destroy the document. THANK YOU. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Setting disable attribute dynamically
If the disable attribute is present in a HTML tag it will be disable, no matter what the value of the attribute is. So if I have a s:select and I say disabled=false it will be disabled (renders disabled=disabled). But if we have a text, and we set readonly=false it will not be editable. On my page my action determines my users access level - fullAccess (user can edit anything) or partialAccess (user can edit certian fields but see the other fields) I have a text field set up like this s:textfield readonly=%{fullAccess}. which works fine. But s:select disabled=%{fullAccess} does not work. I tried this s:select s:if test=!fullAccessdisabled=true/sif / But the s:if tag is causing a syntax error. The only solution I came up with was s:if test=!fullAccess s:select disabed=true ... /s:if s:else s:select ... /s:else So I have 2 s:selects and s:radios for every radio/select I would prefer to have it like the textfields so I dont have to have 2 pieces of code for each select and radio. I figured i could do an if around a script block at the bottom of the page and disable them with javascript but that might be a little confusing for future coders who have to work on this. Can anyone think of a good way to achieve this? Thanks, Rich - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
s:property in s:* not interpreted
Hi all ! I have a little issue and I find no clues on the web, so i'm turning myself to you. I have a piece of code like this : div id=menu_image_galleryss:property value='id'/ s:property id=s:property value='id'/ value=id/ s:a theme=ajax href=%{EditImageGallery} targets=dataImageDivs:property value='id'/Edit/s:a s:a theme=ajax href=%{MoveImageGallery} targets=dataImageDivs:property value='id'/Move/s:a s:a theme=ajax href=%{copyImageGallery} targets=dataImageDivs:property value='id'/Copy/s:a /div div id=dataImageDivs:property value='id'/ / this piece of code is placed in a loop, and creates a small menu for each images I have in galleries. The dataImageDiv is used to contain whatever form I need. The problem is that my s:property tags contained in my s:a tags aren't interpreted. After few manipulations, I observed that the s:property tag is interpreted only if it's not contained in a struts tag. For instance : div id=dataImageDivs:property value='id'/ / produces div id=dataImageDiv1 / BUT s:div id=dataImageDivs:property value='id'/ / produces div id=dataImageDivs:property value='id'/ / Thus, my piece of code produces : div id=menu_image_gallerys1 1 s:a theme=ajax href=%{EditImageGallery} targets=dataImageDivs:property value='id'/Edit/s:a s:a theme=ajax href=%{MoveImageGallery} targets=dataImageDivs:property value='id'/Move/s:a s:a theme=ajax href=%{copyImageGallery} targets=dataImageDivs:property value='id'/Copy/s:a /div div id=dataImageDiv1/ As I'm using this in a loop, it's obviously not working, the targets and the divs not matching. This is driving me nuts. Do I do something wrong ? Would you have an idea ? The s:head theme=ajax/ is well included in my header. Thanks in advance, Matthieu
Re: Setting disable attribute dynamically
I made a slight error readonly=%{fullAccess} with s:textfield does not work but input type=text name=description id=description s:if test=!fullAccessreadonly=true/s:if / works. On Thu, Mar 13, 2008 at 10:48 AM, Richard Sayre [EMAIL PROTECTED] wrote: If the disable attribute is present in a HTML tag it will be disable, no matter what the value of the attribute is. So if I have a s:select and I say disabled=false it will be disabled (renders disabled=disabled). But if we have a text, and we set readonly=false it will not be editable. On my page my action determines my users access level - fullAccess (user can edit anything) or partialAccess (user can edit certian fields but see the other fields) I have a text field set up like this s:textfield readonly=%{fullAccess}. which works fine. But s:select disabled=%{fullAccess} does not work. I tried this s:select s:if test=!fullAccessdisabled=true/sif / But the s:if tag is causing a syntax error. The only solution I came up with was s:if test=!fullAccess s:select disabed=true ... /s:if s:else s:select ... /s:else So I have 2 s:selects and s:radios for every radio/select I would prefer to have it like the textfields so I dont have to have 2 pieces of code for each select and radio. I figured i could do an if around a script block at the bottom of the page and disable them with javascript but that might be a little confusing for future coders who have to work on this. Can anyone think of a good way to achieve this? Thanks, Rich - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s:property in s:* not interpreted
try: s:a theme=ajax href=%{copyImageGallery} targets=dataImageDiv%{id}/Copy/s:a if id is on the stack, you can get it with OGNL On Thu, Mar 13, 2008 at 10:49 AM, matthieu martin [EMAIL PROTECTED] wrote: Hi all ! I have a little issue and I find no clues on the web, so i'm turning myself to you. I have a piece of code like this : div id=menu_image_galleryss:property value='id'/ s:property id=s:property value='id'/ value=id/ s:a theme=ajax href=%{EditImageGallery} targets=dataImageDivs:property value='id'/Edit/s:a s:a theme=ajax href=%{MoveImageGallery} targets=dataImageDivs:property value='id'/Move/s:a s:a theme=ajax href=%{copyImageGallery} targets=dataImageDivs:property value='id'/Copy/s:a /div div id=dataImageDivs:property value='id'/ / this piece of code is placed in a loop, and creates a small menu for each images I have in galleries. The dataImageDiv is used to contain whatever form I need. The problem is that my s:property tags contained in my s:a tags aren't interpreted. After few manipulations, I observed that the s:property tag is interpreted only if it's not contained in a struts tag. For instance : div id=dataImageDivs:property value='id'/ / produces div id=dataImageDiv1 / BUT s:div id=dataImageDivs:property value='id'/ / produces div id=dataImageDivs:property value='id'/ / Thus, my piece of code produces : div id=menu_image_gallerys1 1 s:a theme=ajax href=%{EditImageGallery} targets=dataImageDivs:property value='id'/Edit/s:a s:a theme=ajax href=%{MoveImageGallery} targets=dataImageDivs:property value='id'/Move/s:a s:a theme=ajax href=%{copyImageGallery} targets=dataImageDivs:property value='id'/Copy/s:a /div div id=dataImageDiv1/ As I'm using this in a loop, it's obviously not working, the targets and the divs not matching. This is driving me nuts. Do I do something wrong ? Would you have an idea ? The s:head theme=ajax/ is well included in my header. Thanks in advance, Matthieu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s:property in s:* not interpreted
--- matthieu martin [EMAIL PROTECTED] wrote: s:property id=s:property value='id'/ value=id/ That's not valid XML; you can't nest tags like that. Off the top of my head I don't recall if the id attribute will eval OGNL or not. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Parameters: Invalid chunk ignored (parameters not passed)
Add parameter formFilter=formFilter to your s:submit .../ and create Javascript function in head function formFilter(element) { return true; } it's funny but works! :-) Rushikesh Thakkar wrote: Kindly help.. I have not been able to solve it yet. -- Forwarded message -- From: Rushikesh Thakkar [EMAIL PROTECTED] Date: Fri, Mar 7, 2008 at 3:40 PM Subject: Parameters: Invalid chunk ignored (parameters not passed) To: Struts Users Mailing List user@struts.apache.org I am facing a strange problem. When I use s:submit *theme=ajax targets=requestDiv* / I get the following error on the console: 07.mar.2008 15:30:46 org.apache.tomcat.util.http.ParametersprocessParameters WARNING: Parameters: Invalid chunk ignored. and the parameters are not passed properly (So, my Action fails), but after *removing* *theme=ajax targets=requestDiv*, it works fine. If I change the jsp back to s:submit theme=ajax targets=requestDiv /, then it starts working fine. Please can anybody tell me what is wrong with my application? Please help me, it is urgent. -- View this message in context: http://www.nabble.com/Parameters%3A-Invalid-chunk-ignored-%28parameters-not-passed%29-tp15898111p16026129.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s:property in s:* not interpreted
On Thu, Mar 13, 2008 at 3:26 PM, Richard Sayre [EMAIL PROTECTED] wrote: try: s:a theme=ajax href=%{copyImageGallery} targets=dataImageDiv%{id}/Copy/s:a if id is on the stack, you can get it with OGNL This works, thanks a lot. I haven't working for a long time with struts 2 and I still have some issues figuring out what's on the stack and what's not ... thanks again ! On Thu, Mar 13, 2008 at 10:49 AM, matthieu martin [EMAIL PROTECTED] wrote: Hi all ! I have a little issue and I find no clues on the web, so i'm turning myself to you. I have a piece of code like this : div id=menu_image_galleryss:property value='id'/ s:property id=s:property value='id'/ value=id/ s:a theme=ajax href=%{EditImageGallery} targets=dataImageDivs:property value='id'/Edit/s:a s:a theme=ajax href=%{MoveImageGallery} targets=dataImageDivs:property value='id'/Move/s:a s:a theme=ajax href=%{copyImageGallery} targets=dataImageDivs:property value='id'/Copy/s:a /div div id=dataImageDivs:property value='id'/ / this piece of code is placed in a loop, and creates a small menu for each images I have in galleries. The dataImageDiv is used to contain whatever form I need. The problem is that my s:property tags contained in my s:a tags aren't interpreted. After few manipulations, I observed that the s:property tag is interpreted only if it's not contained in a struts tag. For instance : div id=dataImageDivs:property value='id'/ / produces div id=dataImageDiv1 / BUT s:div id=dataImageDivs:property value='id'/ / produces div id=dataImageDivs:property value='id'/ / Thus, my piece of code produces : div id=menu_image_gallerys1 1 s:a theme=ajax href=%{EditImageGallery} targets=dataImageDivs:property value='id'/Edit/s:a s:a theme=ajax href=%{MoveImageGallery} targets=dataImageDivs:property value='id'/Move/s:a s:a theme=ajax href=%{copyImageGallery} targets=dataImageDivs:property value='id'/Copy/s:a /div div id=dataImageDiv1/ As I'm using this in a loop, it's obviously not working, the targets and the divs not matching. This is driving me nuts. Do I do something wrong ? Would you have an idea ? The s:head theme=ajax/ is well included in my header. Thanks in advance, Matthieu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Getting error in using tag library : The Tag class 'org.apache.struts.taglib.html.FormTag' has no setter method corresponding to TLD declared attribute 'acceptCharset', (JSP 1.1 spec, 5.4.1)
When I deploying my War file in Weblogic 8.1, I am getting the following error: Error in using tag library uri='/WEB-INF/tlds/struts-html.tld' prefix='html': The Tag class 'org.apache.struts.taglib.html.FormTag' has no setter method corresponding to TLD declared attribute 'acceptCharset', (JSP 1.1 spec, 5.4.1) please help me to findout the solution. -- View this message in context: http://www.nabble.com/Getting-error-in-using-tag-library-%3A-The-Tag-class-%27org.apache.struts.taglib.html.FormTag%27-has-no-setter-method-corresponding-to-TLD-declared-attribute-%27acceptCharset%27%2C-%28JSP-1.1-spec%2C-5.4.1%29-tp16026918p16026918.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ajax file upload
Hi all ! I have a rather disturbing issue with a file upload. I have the s:file tag used along with a form. This works just fine, I get my files on the server. In my action, I move my file where I want to, and I create my entry in the database. I refresh my div containing my images. The problem is this one : I do my upload, my topics are notified, my div is refreshed. I get a javascript error : dojo is not defined (even though I do have s:head theme=ajax/ in my header...) and a stacktrace underneath showing a very confusing error : a NullPointerException in my action. I checked my code, nothing special, I change my code, add some lines, retry and it gives me the exact same message (same line). On the client side, instead of having the content of my div I have this : [object HTMLDocument] The weirdest thing is that if I refresh, everything works fine, I have my div with everything I want. I saw on the web that it might be caused by the handleAs attribute of the dojo widget, when it's set to text it works fine, but when it's set to html this message appears. As I want to display images, it could be linked, but why is it working when I refresh my page. The last thing is that my form containing the s:file tag is submitted via an ajax submit tag. Here are relevant pieces of code for this matter. The upload form : s:form action=addFileToGallery enctype=multipart/form-data s:file name=images id=images accept=* / s:submit theme=ajax targets=gallery_images notifyTopics=/addFile/ /s:form The stacktrace indicates a line the method addFile which is the method pointed by the addFileToGallery action: action name=addFileToGallery method=addFile class=galleryAction resultpages/admin/gallery/galleryFiche.jsp/result result name=inputpages/admin/gallery/galleryFiche.jsp/result /action The div containing the images s:url action=viewFileOfGallery id=viewFileOfGallery/ s:div id=gallery_images theme=ajax cssStyle=border:black solid 1px; href=%{viewFileOfGallery} loadingText=Loading ... listenTopics=/refreshGalleryImages / There it is, thanks in advance for any kind of help you may provide ! Matthieu
Re: Getting error in using tag library : The Tag class 'org.apache.struts.taglib.html.FormTag' has no setter method corresponding to TLD declared attribute 'acceptCharset', (JSP 1.1 spec, 5.4.1)
2008/3/13, kannan_307 [EMAIL PROTECTED]: When I deploying my War file in Weblogic 8.1, I am getting the following error: Error in using tag library uri='/WEB-INF/tlds/struts-html.tld' prefix='html': The Tag class 'org.apache.struts.taglib.html.FormTag' has no setter method corresponding to TLD declared attribute 'acceptCharset', (JSP 1.1 spec, 5.4.1) What version of Struts do you use? Antonio
Re: Parameters: Invalid chunk ignored (parameters not passed)
I tried it and Its Not Working !! Thanks anyways, but can you tell me what does it do? I didn't find any property as 'formFilter' in the documentation given for s:submit / in the tag reference. On Thu, Mar 13, 2008 at 3:32 PM, bierb [EMAIL PROTECTED] wrote: Add parameter formFilter=formFilter to your s:submit .../ and create Javascript function in head function formFilter(element) { return true; } it's funny but works! :-) Rushikesh Thakkar wrote: Kindly help.. I have not been able to solve it yet. -- Forwarded message -- From: Rushikesh Thakkar [EMAIL PROTECTED] Date: Fri, Mar 7, 2008 at 3:40 PM Subject: Parameters: Invalid chunk ignored (parameters not passed) To: Struts Users Mailing List user@struts.apache.org I am facing a strange problem. When I use s:submit *theme=ajax targets=requestDiv* / I get the following error on the console: 07.mar.2008 15:30:46 org.apache.tomcat.util.http.ParametersprocessParameters WARNING: Parameters: Invalid chunk ignored. and the parameters are not passed properly (So, my Action fails), but after *removing* *theme=ajax targets=requestDiv*, it works fine. If I change the jsp back to s:submit theme=ajax targets=requestDiv /, then it starts working fine. Please can anybody tell me what is wrong with my application? Please help me, it is urgent. -- View this message in context: http://www.nabble.com/Parameters%3A-Invalid-chunk-ignored-%28parameters-not-passed%29-tp15898111p16026129.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Parameters: Invalid chunk ignored (parameters not passed)
--- Rushikesh Thakkar [EMAIL PROTECTED] wrote: Thanks anyways, but can you tell me what does it do? I didn't find any property as 'formFilter' in the documentation given for s:submit / in the tag reference. http://struts.apache.org/2.0.11.1/docs/dojo-submit.html Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s:property in s:* not interpreted
Dave Newton wrote: --- matthieu martin [EMAIL PROTECTED] wrote: s:property id=s:property value='id'/ value=id/ That's not valid XML; you can't nest tags like that. Off the top of my head I don't recall if the id attribute will eval OGNL or not. To be pedantic, JSPs are not XML files and thus don't have to be valid; hence div id=s:property... works. What is not legal in a JSP is nesting custom actions (i.e. those tags that get processed by the JSP compiler). L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s:property in s:* not interpreted
Laurie Harper wrote: Dave Newton wrote: --- matthieu martin [EMAIL PROTECTED] wrote: s:property id=s:property value='id'/ value=id/ That's not valid XML; you can't nest tags like that. Off the top of my head I don't recall if the id attribute will eval OGNL or not. To be pedantic, JSPs are not XML files ...unless you use the XML syntax available from JSP 2.0 and later ;-) Cheers, Manos - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Parameters: Invalid chunk ignored (parameters not passed)
Thanks Dave. Thats the one I am using, but I was referring to http://struts.apache.org/2.x/docs/submit.html Bierb, can you tell me what does your code do? I might get an idea.. Does anybody have an Idea of when this error is thrown? 07.mar.2008 15:30:46 org.apache.tomcat.util.http.ParametersprocessParameters WARNING: Parameters: Invalid chunk ignored. On Thu, Mar 13, 2008 at 4:19 PM, Dave Newton [EMAIL PROTECTED] wrote: --- Rushikesh Thakkar [EMAIL PROTECTED] wrote: Thanks anyways, but can you tell me what does it do? I didn't find any property as 'formFilter' in the documentation given for s:submit / in the tag reference. http://struts.apache.org/2.0.11.1/docs/dojo-submit.html Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting disable attribute dynamically
I have done it.. It goes like this: (1) The Action: public class PrepareScreen extends ActionSupport { private String yesOrNo; public String execute() throws Exception { yesOrNo = true; return SUCCESS; } public String getYesOrNo() { return yesOrNo; } public void setYesOrNo(String yesOrNo) { this.yesOrNo = yesOrNo; } } (2) The JSP: Is Struts2 good?: s:textfield name=choice readonly=%{yesOrNo} value=Yes, it is../s:textfield regards, Rushikesh On Thu, Mar 13, 2008 at 3:24 PM, Richard Sayre [EMAIL PROTECTED] wrote: I made a slight error readonly=%{fullAccess} with s:textfield does not work but input type=text name=description id=description s:if test=!fullAccessreadonly=true/s:if / works. On Thu, Mar 13, 2008 at 10:48 AM, Richard Sayre [EMAIL PROTECTED] wrote: If the disable attribute is present in a HTML tag it will be disable, no matter what the value of the attribute is. So if I have a s:select and I say disabled=false it will be disabled (renders disabled=disabled). But if we have a text, and we set readonly=false it will not be editable. On my page my action determines my users access level - fullAccess (user can edit anything) or partialAccess (user can edit certian fields but see the other fields) I have a text field set up like this s:textfield readonly=%{fullAccess}. which works fine. But s:select disabled=%{fullAccess} does not work. I tried this s:select s:if test=!fullAccessdisabled=true/sif / But the s:if tag is causing a syntax error. The only solution I came up with was s:if test=!fullAccess s:select disabed=true ... /s:if s:else s:select ... /s:else So I have 2 s:selects and s:radios for every radio/select I would prefer to have it like the textfields so I dont have to have 2 pieces of code for each select and radio. I figured i could do an if around a script block at the bottom of the page and disable them with javascript but that might be a little confusing for future coders who have to work on this. Can anyone think of a good way to achieve this? Thanks, Rich - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting disable attribute dynamically
Ha ha I was trying this and couldn;t get it to work. My mistake was fullAccess = true, so readOnly=%{fullAccess} was returning true, i meant to say readOnly=%{!fullAccess}. thanks On Thu, Mar 13, 2008 at 1:01 PM, Rushikesh Thakkar [EMAIL PROTECTED] wrote: I have done it.. It goes like this: (1) The Action: public class PrepareScreen extends ActionSupport { private String yesOrNo; public String execute() throws Exception { yesOrNo = true; return SUCCESS; } public String getYesOrNo() { return yesOrNo; } public void setYesOrNo(String yesOrNo) { this.yesOrNo = yesOrNo; } } (2) The JSP: Is Struts2 good?: s:textfield name=choice readonly=%{yesOrNo} value=Yes, it is../s:textfield regards, Rushikesh On Thu, Mar 13, 2008 at 3:24 PM, Richard Sayre [EMAIL PROTECTED] wrote: I made a slight error readonly=%{fullAccess} with s:textfield does not work but input type=text name=description id=description s:if test=!fullAccessreadonly=true/s:if / works. On Thu, Mar 13, 2008 at 10:48 AM, Richard Sayre [EMAIL PROTECTED] wrote: If the disable attribute is present in a HTML tag it will be disable, no matter what the value of the attribute is. So if I have a s:select and I say disabled=false it will be disabled (renders disabled=disabled). But if we have a text, and we set readonly=false it will not be editable. On my page my action determines my users access level - fullAccess (user can edit anything) or partialAccess (user can edit certian fields but see the other fields) I have a text field set up like this s:textfield readonly=%{fullAccess}. which works fine. But s:select disabled=%{fullAccess} does not work. I tried this s:select s:if test=!fullAccessdisabled=true/sif / But the s:if tag is causing a syntax error. The only solution I came up with was s:if test=!fullAccess s:select disabed=true ... /s:if s:else s:select ... /s:else So I have 2 s:selects and s:radios for every radio/select I would prefer to have it like the textfields so I dont have to have 2 pieces of code for each select and radio. I figured i could do an if around a script block at the bottom of the page and disable them with javascript but that might be a little confusing for future coders who have to work on this. Can anyone think of a good way to achieve this? Thanks, Rich - 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: property in s:* not interpreted
I actually thought you couldn't nest s:* tags. You can nest them in regular HTML tags because the JSP and the HTML are interpreted at different steps, so from the separate perspectives of the two parsers there's not really any nesting going on (the JSP parser on the server only cares about JSP tags, and the HTML parser on the browser only sees the output). Perhaps instead you could use an OGNL expression to concatenate the ID onto the end of a string constant? ~DVA -Original Message- From: matthieu martin [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2008 10:20 AM To: user@struts.apache.org Subject: s:property in s:* not interpreted Hi all ! I have a little issue and I find no clues on the web, so i'm turning myself to you. I have a piece of code like this : div id=menu_image_galleryss:property value='id'/ s:property id=s:property value='id'/ value=id/ s:a theme=ajax href=%{EditImageGallery} targets=dataImageDivs:property value='id'/Edit/s:a s:a theme=ajax href=%{MoveImageGallery} targets=dataImageDivs:property value='id'/Move/s:a s:a theme=ajax href=%{copyImageGallery} targets=dataImageDivs:property value='id'/Copy/s:a /div div id=dataImageDivs:property value='id'/ / this piece of code is placed in a loop, and creates a small menu for each images I have in galleries. The dataImageDiv is used to contain whatever form I need. The problem is that my s:property tags contained in my s:a tags aren't interpreted. After few manipulations, I observed that the s:property tag is interpreted only if it's not contained in a struts tag. For instance : div id=dataImageDivs:property value='id'/ / produces div id=dataImageDiv1 / BUT s:div id=dataImageDivs:property value='id'/ / produces div id=dataImageDivs:property value='id'/ / Thus, my piece of code produces : div id=menu_image_gallerys1 1 s:a theme=ajax href=%{EditImageGallery} targets=dataImageDivs:property value='id'/Edit/s:a s:a theme=ajax href=%{MoveImageGallery} targets=dataImageDivs:property value='id'/Move/s:a s:a theme=ajax href=%{copyImageGallery} targets=dataImageDivs:property value='id'/Copy/s:a /div div id=dataImageDiv1/ As I'm using this in a loop, it's obviously not working, the targets and the divs not matching. This is driving me nuts. Do I do something wrong ? Would you have an idea ? The s:head theme=ajax/ is well included in my header. Thanks in advance, Matthieu -- This message may contain confidential, proprietary, or legally privileged information. No confidentiality or privilege is waived by any transmission to an unintended recipient. If you are not an intended recipient, please notify the sender and delete this message immediately. Any views expressed in this message are those of the sender, not those of any entity within the KBC Financial Products group of companies (together referred to as KBC FP). This message does not create any obligation, contractual or otherwise, on the part of KBC FP. It is not an offer (or solicitation of an offer) of, or a recommendation to buy or sell, any financial product. Any prices or other values included in this message are indicative only, and do not necessarily represent current market prices, prices at which KBC FP would enter into a transaction, or prices at which similar transactions may be carried on KBC FP's own books. The information contained in this message is provided as is, without representations or warranties, express or implied, of any kind. Past performance is not indicative of future returns. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 2 Weblogic and NTLM
I am attaching a WAR file which uses code to obtain the user id via NTLM. This code works fine on Tomcat and Weblogic 9.2 on unix (if i do not use s:form/ in the Home.jsp - I do not know why that breaks http://www.nabble.com/file/p16032835/NTLM1.war NTLM1.war ) This WAR does not work on Weblogic 9.2 Windows 2000 as i get the following error Header:WWW-Authenticate Cannot contain CRLF Charcters Here is the code in the Action class. *** package com.dgv.actions; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts2.interceptor.ServletRequestAware; import org.apache.struts2.interceptor.ServletResponseAware; import org.apache.struts2.interceptor.SessionAware; import com.dgv.security.NTLMLogin; import com.dgv.util.Util; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.Preparable; public class BaseAction extends ActionSupport implements SessionAware, ServletRequestAware, ServletResponseAware, Preparable{ private Map session; private HttpServletRequest request; private HttpServletResponse response; public void setSession(Map arg0) { this.session = arg0; } public void setServletRequest(HttpServletRequest arg0) { // TODO Auto-generated method stub this.request = arg0; } public HttpServletRequest getServletRequest() { // TODO Auto-generated method stub return request; } public void prepare() throws Exception { System.out.println(Entered Prepare Method); String auth = request.getHeader(Authorization); if (auth == null) { System.out.println(Inside Null); response.setStatus(response.SC_UNAUTHORIZED); response.setHeader(WWW-Authenticate, NTLM); return; } System.out.println(outside Null); if (auth.startsWith(NTLM )) { byte[] msg = new sun.misc.BASE64Decoder().decodeBuffer(auth.substring(5)); int off = 30, length=0, offset; String s; if (msg[8] == 1) { // first step of authentication off = 18; // this part is for full hand-shaking, just tested, didn't care about result passwords byte z = 0; byte[] msg1 = {(byte)'N', (byte)'T', (byte)'L', (byte)'M', (byte)'S', (byte)'S', (byte)'P', z, (byte)2, z, z, z, z, z, z, z, (byte)40, z, z, z, (byte)1, (byte)130, z, z, z, (byte)2, (byte)2, (byte)2, z, z, z, z, // this line is 'nonce' z, z, z, z, z, z, z, z}; // remove next lines if you want see the result of first step response.setStatus(response.SC_UNAUTHORIZED); System.out.println(Before Setting Header); response.setHeader(WWW-Authenticate, NTLM + new sun.misc.BASE64Encoder().encodeBuffer(msg1)); System.out.println(Header:+ request.getHeader(WWW-Authenticate)); return; } else //return; length = msg[off+9]*256 + msg[off+8]; offset = msg[off+11]*256 + msg[off+10]; s = new String(msg, offset, length); System.out.println(**USER +s + ); } } public void setServletResponse(HttpServletResponse arg0) { this.response = arg0; } public HttpServletResponse getServletResponse() { return response; } } ** Any help would be greatly appreciated. -- View this message in context: http://www.nabble.com/Struts-2-Weblogic-and-NTLM-tp16032835p16032835.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Proxy action and s:submit/ tag
I am working on a piece of code where a single action services several methods. It uses a wildcard mapping and the method attribute of the s:button/ tag is what drives the specific methods. I was unable to get the validators to work and started debugging the AnnotationValidationInterceptor to discover that the invocation.getProxy().getActionName() is not being updated with the current request as different methods are invoked. There are no attributes on the s:form tag since the action that serves this page is the same action that services the associated submit button. Has anyone experienced this? -- Scott [EMAIL PROTECTED]
Re: Problem accessing GET parameter in Struts2
Thanks to your hint I found the mistake :-) Dave Newton wrote: I tried to get some debug information from the params interceptor and put the following code into my struts.xml (inside the action): interceptor-ref name=params param name=logEnabledtrue/param param name=logLevelDEBUG/param /interceptor-ref Nate that when you use an interceptor-ref element inside an action configuration then *only* that interceptor-ref will be configured for that action: this means that in this case if this is the only interceptor-ref inside the action element then *only* the params interceptor will be run for that action. This is probably not what you want. After inserting the basicStack interceptor into the action, the variable was correctly initialized: interceptor-ref name=params / interceptor-ref name=basicStack / Nevertheless, I still don't get any log info from the interceptors. Christoph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with submitting html:form while using NTLM authentication
Check if form action=query works. I had the same issue with this on a UNIX environment(struts 2). When i replaced the s:form tag with the regular form tag...it worked fine Tarun Reddy wrote: Hi all, I'm using NTLM authentication to let the user in. After the user gets into the application, he'll be shown a jsp page, which typically contains an html:form action=query. After user enters his inputs and submits the form, the values are not submitted as part of the HTTP Request. If I modify the form as, html:form action=query method=GET , then everything works fine i.e the values are being passed to the action class. If I remove the NTLM authentication in the first login jsp page, then html:form works fine with POST method. So, I feel that this is some issue pertaining to the use of html:form in conjunction with NTLM authentication. Did any one of you had experienced this problem? Why the input values entered by user are not passed as part of HTTP request? I can see the Content-Type of the request as, application/x-www-form-urlencoded. Everything looks fine. That's what baffling me. I'm in urgent need of it. I would really appreciate your help. Thanks, Tarun. -- View this message in context: http://www.nabble.com/Problem-with-submitting-%3Chtml%3Aform%3E-while-using-NTLM-authentication-tp3868393p16032992.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 Weblogic and NTLM
Ok i found out what was going wrong. I used the sun package to encode new sun.misc.BASE64Encoder().encodeBuffer(msg1) I replaced it with a class I got from http://iharder.net/base64 and it works fine now. I did not know sun.* apis are not supposed to be used dgv123 wrote: I am attaching a WAR file which uses code to obtain the user id via NTLM. This code works fine on Tomcat and Weblogic 9.2 on unix (if i do not use s:form/ in the Home.jsp - I do not know why that breaks http://www.nabble.com/file/p16032835/NTLM1.war NTLM1.war ) This WAR does not work on Weblogic 9.2 Windows 2000 as i get the following error Header:WWW-Authenticate Cannot contain CRLF Charcters Here is the code in the Action class. *** package com.dgv.actions; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts2.interceptor.ServletRequestAware; import org.apache.struts2.interceptor.ServletResponseAware; import org.apache.struts2.interceptor.SessionAware; import com.dgv.security.NTLMLogin; import com.dgv.util.Util; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.Preparable; public class BaseAction extends ActionSupport implements SessionAware, ServletRequestAware, ServletResponseAware, Preparable{ private Map session; private HttpServletRequest request; private HttpServletResponse response; public void setSession(Map arg0) { this.session = arg0; } public void setServletRequest(HttpServletRequest arg0) { // TODO Auto-generated method stub this.request = arg0; } public HttpServletRequest getServletRequest() { // TODO Auto-generated method stub return request; } public void prepare() throws Exception { System.out.println(Entered Prepare Method); String auth = request.getHeader(Authorization); if (auth == null) { System.out.println(Inside Null); response.setStatus(response.SC_UNAUTHORIZED); response.setHeader(WWW-Authenticate, NTLM); return; } System.out.println(outside Null); if (auth.startsWith(NTLM )) { byte[] msg = new sun.misc.BASE64Decoder().decodeBuffer(auth.substring(5)); int off = 30, length=0, offset; String s; if (msg[8] == 1) { // first step of authentication off = 18; // this part is for full hand-shaking, just tested, didn't care about result passwords byte z = 0; byte[] msg1 = {(byte)'N', (byte)'T', (byte)'L', (byte)'M', (byte)'S', (byte)'S', (byte)'P', z, (byte)2, z, z, z, z, z, z, z, (byte)40, z, z, z, (byte)1, (byte)130, z, z, z, (byte)2, (byte)2, (byte)2, z, z, z, z, // this line is 'nonce' z, z, z, z, z, z, z, z}; // remove next lines if you want see the result of first step response.setStatus(response.SC_UNAUTHORIZED); System.out.println(Before Setting Header); response.setHeader(WWW-Authenticate, NTLM + new sun.misc.BASE64Encoder().encodeBuffer(msg1)); System.out.println(Header:+ request.getHeader(WWW-Authenticate)); return; } else //return; length = msg[off+9]*256 + msg[off+8]; offset = msg[off+11]*256 + msg[off+10]; s = new String(msg, offset, length); System.out.println(**USER +s + ); } } public void setServletResponse(HttpServletResponse arg0) { this.response = arg0; } public HttpServletResponse getServletResponse() { return response; } } ** Any help would be greatly appreciated. -- View this message in context: http://www.nabble.com/Struts-2-Weblogic-and-NTLM-tp16032835p16037640.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSON plugin
I am trying to use dojo and the JSON plugin, but I have hit a snag. I am using JSON to serialize: ArrayListProject projectList. It seems to do this fine, as I can see the result in firebug. The problem I am having is that the JSON response seems to be missing something, and I cant figure out how to remedy this. This is the dojo example json: { cobblers: [ {filling: peach, timeToBake: 30 }, {filling: cherry, timeToBake: 35 }, {filling: blueberry, timeToBake: 30} ] } This is how they parse it (abbreviated): console.dir(responseObject.cobblers[0].filling); // Prints peach In my code I run console.dir(responseObject); and get this displayed in firebug: [ { acdate:null, approved:false, id:236, lead:{cuid:hsimpso,id:2,name:null,role:2}, loe:{id:2,name:Medium}, mos:Create something., name:Alarming page, owner:{cuid:mburns,id:14,name:null,role:0}, priority:{id:1,name:High}, result:Waiting on something, status:{hlaOnly:null,id:6,name:OnHold}, stdate:2006-03-14T00:00:00, tcdate:2006-05-12T00:00:00 }, { acdate:2008-02-01T00:00:00, approved:false, id:1749, lead:{cuid:mxsimps,id:2,name:null,role:2}, loe:{id:4,name:Extra Large}, mos:Rewrite stuff., name:Rewrite that, owner:{cuid:mburns,id:14,name:null,role:0}, priority:{id:1,name:High}, result:I done did it, status:{hlaOnly:null,id:4,name:Completed}, stdate:2007-07-16T00:00:00, tcdate:2008-02-01T00:00:00 } ] That seems okay to me. I hit the snag when I try something like this: console.debug(responseObject.projectList[0].name); This is whats returned: responseObject.projectList has no properties Im not sure how to address the response. Any ideas? -Ryan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
Re: JSON plugin
you don't have a projectList field in the response, only an array of objects. If you do: responseObject[0].name it will return Alarming page. musachy On Thu, Mar 13, 2008 at 4:30 PM, Stanley, Eric [EMAIL PROTECTED] wrote: I am trying to use dojo and the JSON plugin, but I have hit a snag. I am using JSON to serialize: ArrayListProject projectList. It seems to do this fine, as I can see the result in firebug. The problem I am having is that the JSON response seems to be missing something, and I cant figure out how to remedy this. This is the dojo example json: { cobblers: [ {filling: peach, timeToBake: 30 }, {filling: cherry, timeToBake: 35 }, {filling: blueberry, timeToBake: 30} ] } This is how they parse it (abbreviated): console.dir(responseObject.cobblers[0].filling); // Prints peach In my code I run console.dir(responseObject); and get this displayed in firebug: [ { acdate:null, approved:false, id:236, lead:{cuid:hsimpso,id:2,name:null,role:2}, loe:{id:2,name:Medium}, mos:Create something., name:Alarming page, owner:{cuid:mburns,id:14,name:null,role:0}, priority:{id:1,name:High}, result:Waiting on something, status:{hlaOnly:null,id:6,name:OnHold}, stdate:2006-03-14T00:00:00, tcdate:2006-05-12T00:00:00 }, { acdate:2008-02-01T00:00:00, approved:false, id:1749, lead:{cuid:mxsimps,id:2,name:null,role:2}, loe:{id:4,name:Extra Large}, mos:Rewrite stuff., name:Rewrite that, owner:{cuid:mburns,id:14,name:null,role:0}, priority:{id:1,name:High}, result:I done did it, status:{hlaOnly:null,id:4,name:Completed}, stdate:2007-07-16T00:00:00, tcdate:2008-02-01T00:00:00 } ] That seems okay to me. I hit the snag when I try something like this: console.debug(responseObject.projectList[0].name); This is whats returned: responseObject.projectList has no properties Im not sure how to address the response. Any ideas? -Ryan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSON plugin
Musachy, Thanks for the quick reply. I just added what you suggested and tried it. This is the response: undefined What else can I check? -Ryan -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2008 2:36 PM To: Struts Users Mailing List Subject: Re: JSON plugin you don't have a projectList field in the response, only an array of objects. If you do: responseObject[0].name it will return Alarming page. musachy On Thu, Mar 13, 2008 at 4:30 PM, Stanley, Eric [EMAIL PROTECTED] wrote: I am trying to use dojo and the JSON plugin, but I have hit a snag. I am using JSON to serialize: ArrayListProject projectList. It seems to do this fine, as I can see the result in firebug. The problem I am having is that the JSON response seems to be missing something, and I cant figure out how to remedy this. This is the dojo example json: { cobblers: [ {filling: peach, timeToBake: 30 }, {filling: cherry, timeToBake: 35 }, {filling: blueberry, timeToBake: 30} ] } This is how they parse it (abbreviated): console.dir(responseObject.cobblers[0].filling); // Prints peach In my code I run console.dir(responseObject); and get this displayed in firebug: [ { acdate:null, approved:false, id:236, lead:{cuid:hsimpso,id:2,name:null,role:2}, loe:{id:2,name:Medium}, mos:Create something., name:Alarming page, owner:{cuid:mburns,id:14,name:null,role:0}, priority:{id:1,name:High}, result:Waiting on something, status:{hlaOnly:null,id:6,name:OnHold}, stdate:2006-03-14T00:00:00, tcdate:2006-05-12T00:00:00 }, { acdate:2008-02-01T00:00:00, approved:false, id:1749, lead:{cuid:mxsimps,id:2,name:null,role:2}, loe:{id:4,name:Extra Large}, mos:Rewrite stuff., name:Rewrite that, owner:{cuid:mburns,id:14,name:null,role:0}, priority:{id:1,name:High}, result:I done did it, status:{hlaOnly:null,id:4,name:Completed}, stdate:2007-07-16T00:00:00, tcdate:2008-02-01T00:00:00 } ] That seems okay to me. I hit the snag when I try something like this: console.debug(responseObject.projectList[0].name); This is whats returned: responseObject.projectList has no properties Im not sure how to address the response. Any ideas? -Ryan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. -- Hey you! Would you help me to carry the stone? Pink Floyd - 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: JSON plugin
Musachy, I tried just printing out responseObject[i] where I was 1-10, and it returns the actual characters of the response like it is an array: responseObject[0] = [ responseObject[1] = { responseObject[2] = Is it a problem with converting my ArrayListProject into json? -Ryan -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2008 2:36 PM To: Struts Users Mailing List Subject: Re: JSON plugin you don't have a projectList field in the response, only an array of objects. If you do: responseObject[0].name it will return Alarming page. musachy On Thu, Mar 13, 2008 at 4:30 PM, Stanley, Eric [EMAIL PROTECTED] wrote: I am trying to use dojo and the JSON plugin, but I have hit a snag. I am using JSON to serialize: ArrayListProject projectList. It seems to do this fine, as I can see the result in firebug. The problem I am having is that the JSON response seems to be missing something, and I cant figure out how to remedy this. This is the dojo example json: { cobblers: [ {filling: peach, timeToBake: 30 }, {filling: cherry, timeToBake: 35 }, {filling: blueberry, timeToBake: 30} ] } This is how they parse it (abbreviated): console.dir(responseObject.cobblers[0].filling); // Prints peach In my code I run console.dir(responseObject); and get this displayed in firebug: [ { acdate:null, approved:false, id:236, lead:{cuid:hsimpso,id:2,name:null,role:2}, loe:{id:2,name:Medium}, mos:Create something., name:Alarming page, owner:{cuid:mburns,id:14,name:null,role:0}, priority:{id:1,name:High}, result:Waiting on something, status:{hlaOnly:null,id:6,name:OnHold}, stdate:2006-03-14T00:00:00, tcdate:2006-05-12T00:00:00 }, { acdate:2008-02-01T00:00:00, approved:false, id:1749, lead:{cuid:mxsimps,id:2,name:null,role:2}, loe:{id:4,name:Extra Large}, mos:Rewrite stuff., name:Rewrite that, owner:{cuid:mburns,id:14,name:null,role:0}, priority:{id:1,name:High}, result:I done did it, status:{hlaOnly:null,id:4,name:Completed}, stdate:2007-07-16T00:00:00, tcdate:2008-02-01T00:00:00 } ] That seems okay to me. I hit the snag when I try something like this: console.debug(responseObject.projectList[0].name); This is whats returned: responseObject.projectList has no properties Im not sure how to address the response. Any ideas? -Ryan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. -- Hey you! Would you help me to carry the stone? Pink Floyd - 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: struts wml
Laurie Harper, email-me please. I think I have help to you. An emabrace [EMAIL PROTECTED] - Original Message - From: Laurie Harper [EMAIL PROTECTED] To: user@struts.apache.org Sent: Thursday, March 13, 2008 5:26 AM Subject: Re: struts wml Sean Chen wrote: Dear all, The latest struts wml tag library I found is struts-wml 1.1. Does anyone know what I can work with wml tag with struts 1.3.x? Thank you Sean Since I'd never heard of struts-wml I googled, and found the SourceForge project page for it. It doesn't look like it's been active since 2003... Your best bet would probably be to grab the source code and port it to Struts 1.3 yourself. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Informação do NOD32 IMON 2939 (20080312) __ Esta mensagem foi verificada pelo NOD32 sistema antivírus http://www.eset.com.br - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can validation be evaluated ahead of time to paint JQuery validation rules?
I really like the treatment the JQuery http://jquery.bassistance.de/validate/demo/ validation plugin (not struts plugin), gives for a user experience. I would really like the rules to come from back end rules and decorate the form fields the same way if the back end bounces a validation error. Is there anyway to evaluate the validation config ahead of time, so jquery rules can be written? -- View this message in context: http://www.nabble.com/Can-validation-be-evaluated-ahead-of-time-to-paint-JQuery-validation-rules--tp16038820p16038820.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSON plugin
Martin, Im not sure I catch what your saying. I understood it was the json plugin that determined the format of the json response. I am not using an autocompleter either. -Ryan -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2008 4:15 PM To: Stanley, Eric Cc: Struts Users Mailing List Subject: Re: JSON plugin Eric- it appears that its up to your action to return proper JSON formatted results here is the doc Autocompleter input format The text to be returned from your action must be a list in JSON (Javascript Object Notation). Make sure your action returning the JSON list is not decorated adding any extra content. Like: [ [Display Text1, Value1], [Display Text2, Value2] ] you *can* also configure in a valid JSON validator such as so these errors do not happen in View layer.. interceptor-stack name=defaultStack interceptor-ref name=validationWorkflowStack/ /interceptor-stackinterceptor-stack name=validationWorkflowStack interceptor-ref name=basicStack/ interceptor-ref name=validation/ interceptor-ref name=workflow/ /interceptor-stackMartin- - Original Message - From: Stanley, Eric [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, March 13, 2008 3:57 PM Subject: RE: JSON plugin Musachy, I tried just printing out responseObject[i] where I was 1-10, and it returns the actual characters of the response like it is an array: responseObject[0] = [ responseObject[1] = { responseObject[2] = Is it a problem with converting my ArrayListProject into json? -Ryan -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2008 2:36 PM To: Struts Users Mailing List Subject: Re: JSON plugin you don't have a projectList field in the response, only an array of objects. If you do: responseObject[0].name it will return Alarming page. musachy On Thu, Mar 13, 2008 at 4:30 PM, Stanley, Eric [EMAIL PROTECTED] wrote: I am trying to use dojo and the JSON plugin, but I have hit a snag. I am using JSON to serialize: ArrayListProject projectList. It seems to do this fine, as I can see the result in firebug. The problem I am having is that the JSON response seems to be missing something, and I cant figure out how to remedy this. This is the dojo example json: { cobblers: [ {filling: peach, timeToBake: 30 }, {filling: cherry, timeToBake: 35 }, {filling: blueberry, timeToBake: 30} ] } This is how they parse it (abbreviated): console.dir(responseObject.cobblers[0].filling); // Prints peach In my code I run console.dir(responseObject); and get this displayed in firebug: [ { acdate:null, approved:false, id:236, lead:{cuid:hsimpso,id:2,name:null,role:2}, loe:{id:2,name:Medium}, mos:Create something., name:Alarming page, owner:{cuid:mburns,id:14,name:null,role:0}, priority:{id:1,name:High}, result:Waiting on something, status:{hlaOnly:null,id:6,name:OnHold}, stdate:2006-03-14T00:00:00, tcdate:2006-05-12T00:00:00 }, { acdate:2008-02-01T00:00:00, approved:false, id:1749, lead:{cuid:mxsimps,id:2,name:null,role:2}, loe:{id:4,name:Extra Large}, mos:Rewrite stuff., name:Rewrite that, owner:{cuid:mburns,id:14,name:null,role:0}, priority:{id:1,name:High}, result:I done did it, status:{hlaOnly:null,id:4,name:Completed}, stdate:2007-07-16T00:00:00, tcdate:2008-02-01T00:00:00 } ] That seems okay to me. I hit the snag when I try something like this: console.debug(responseObject.projectList[0].name); This is whats returned: responseObject.projectList has no properties Im not sure how to address the response. Any ideas? -Ryan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. -- Hey you! Would you help me to carry the stone? Pink Floyd - 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: [struts] JSON plugin
Stanley, Eric wrote: I tried just printing out responseObject[i] How in your javascript code do you convert the text of the response into responseObject? -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [struts] JSON plugin
Dale, I am using dojo, so here is the snippet that handles the request/response: var kw = { url: url, mimetype: text/json, method: POST, load: function(responseObject, ioArgs) { console.debug(responseObject[0].name); // Dump it to the console return responseObject; }, error: function(data){ alert(An error occurred: + data); }, timeout: 1, }; dojo.xhrPost(kw); -Ryan -Original Message- From: Dale Newfield [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2008 3:28 PM To: Struts Users Mailing List Subject: Re: [struts] JSON plugin Stanley, Eric wrote: I tried just printing out responseObject[i] How in your javascript code do you convert the text of the response into responseObject? -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to initialize business service objects?
Hi all i'm just starting with struts2 (even with struts at all). Of course i first read some how-to-starts. But there is one thing i don't understand. I'm trying to create a simple little chat app. I have two action classes, one for the normal chat user, one for the moderators. Both classes need access to the same instances of business service classes which mainly hold runtime data such as a list of users currently logged in, list of chat rooms and so on. Now i don't understand (1) where to create/initialize these business logic classes and (2) how to get access to them from the action classes. I'm very thankful for any hint. Thanks a lot Frank
Re: [struts] JSON plugin
If response[i] is a char then the response is a text, not an object. If I don't remember wrong dojo builds the object for you when the mimetype is application/json, but I am not sure right now. Use the eval function to turn the text into an object. musachy On Thu, Mar 13, 2008 at 5:31 PM, Stanley, Eric [EMAIL PROTECTED] wrote: Dale, I am using dojo, so here is the snippet that handles the request/response: var kw = { url: url, mimetype: text/json, method: POST, load: function(responseObject, ioArgs) { console.debug(responseObject[0].name); // Dump it to the console return responseObject; }, error: function(data){ alert(An error occurred: + data); }, timeout: 1, }; dojo.xhrPost(kw); -Ryan -Original Message- From: Dale Newfield [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2008 3:28 PM To: Struts Users Mailing List Subject: Re: [struts] JSON plugin Stanley, Eric wrote: I tried just printing out responseObject[i] How in your javascript code do you convert the text of the response into responseObject? -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Latest Quickstart Sitemesh
Hi All, I took the current quickstart application and added sitemesh to the pom.xml and added all the necessary files for sitemesh, the dojo that listed the Persons broke. The decorator works but the ajax failed with Error loading '/quickstart/list.action' (200 OK) Is there any special settings I need to do to fix this problem? Thanks, Doug __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
RE: [struts] JSON plugin
Musachy, That seems to work. I now see the proper response when I call response[0].name. Thanks. -Ryan -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2008 3:45 PM To: Struts Users Mailing List Subject: Re: [struts] JSON plugin If response[i] is a char then the response is a text, not an object. If I don't remember wrong dojo builds the object for you when the mimetype is application/json, but I am not sure right now. Use the eval function to turn the text into an object. musachy On Thu, Mar 13, 2008 at 5:31 PM, Stanley, Eric [EMAIL PROTECTED] wrote: Dale, I am using dojo, so here is the snippet that handles the request/response: var kw = { url: url, mimetype: text/json, method: POST, load: function(responseObject, ioArgs) { console.debug(responseObject[0].name); // Dump it to the console return responseObject; }, error: function(data){ alert(An error occurred: + data); }, timeout: 1, }; dojo.xhrPost(kw); -Ryan -Original Message- From: Dale Newfield [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2008 3:28 PM To: Struts Users Mailing List Subject: Re: [struts] JSON plugin Stanley, Eric wrote: I tried just printing out responseObject[i] How in your javascript code do you convert the text of the response into responseObject? -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - 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: How to initialize business service objects?
For a POJO you can use dependency injection such as Spring or Guice or you can instantiate the object the normal way BusinessServiceObject bso = new BusinessServiceObject(); in your action class. There is nothing special about accessing your BSO's in Struts. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: Frank Fischer [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Thu, 13 Mar 2008 22:32:34 +0100 To: user@struts.apache.org Subject: How to initialize business service objects? Hi all i'm just starting with struts2 (even with struts at all). Of course i first read some how-to-starts. But there is one thing i don't understand. I'm trying to create a simple little chat app. I have two action classes, one for the normal chat user, one for the moderators. Both classes need access to the same instances of business service classes which mainly hold runtime data such as a list of users currently logged in, list of chat rooms and so on. Now i don't understand (1) where to create/initialize these business logic classes and (2) how to get access to them from the action classes. I'm very thankful for any hint. Thanks a lot Frank This email and any attachments (Message) may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation with annotation
The current usage of Annotating methods seems broken. Its still applying all the validation rules to all methods despite methods having different validation requirements. The Struts Zero Config/Annotation/Auto Config needs help Hopefully, a http://jira.opensymphony.com/browse/XW-603 sprinkling of sane configuration of inheritance (though xml) will add power, and reduce redundant configuration code. re: http://jira.opensymphony.com/browse/XW-603 Matt Ealden Escañan wrote: On Tue, Mar 11, 2008 at 7:10 AM, xianwinwin [EMAIL PROTECTED] wrote: assuming registration is composed of fname, lname, ss, dob and except dob all fields are mandatory. Question: how do I make sure those fields will be input? should I have something like: @RequiredStringValidator(message=Legal Name is missing) private setFname(String fn) on the registration - if so - wouldn't that effect other classes that uses registration??? thanks for any input! Hi xianwinwin, You can annotate an action method with @Validations and validate from there, ie: @Validations( requiredString = { @RequiredFieldValidator( type=ValidatorType.FIELD, fieldName=registration.fname message=Foo! ) } ) public String save() { ... } http://struts.apache.org/2.x/docs/validation-annotation.html Admittedly, I used this approach these past few days and found myself back to validations in XML: http://blog.ealden.net/2008/03/working-with-struts-2-validators.html Thanks -- Ealden Esto E. Escañan http://blog.ealden.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/validation-with-annotation-tp15966492p16039860.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to initialize business service objects?
Hi Randy Hi all I just read a bit regarding Spring. As far as i understand its focus is on J2EE appllications. I guess for what i want to do in a first step (my simple chat app) it would be overkill to use Spring. Do i get that right? I would prefere to go the most simple way if possible. So, just instantiating my BusinessServiceObject the common way would be fine for me. I just don't understand how can i get access to a BusinessServiceObject created in one of my Action classes from another Action class. Just by declaring it as static? Second thing i don't understand is, when will action objects be intatiated in the application server? As far as i remember from the early days of servlet programming (when i had to do with this technology the last time) the servlets are intantiated upon the first request. In a normal Servlet based Web app i would have intiantiated BusinessServiceObjects in a filter and placed them to the ServletContext. So i could be sure it's instantiated before the first request arrives and i can get a reference to it from anywhere in my web app. But with Struts i don't see how i could do so. I know this might sound a little bit confused. Can you help me to get on track again? Thanks for your help Frank -Original Message- From: Randy Burgess [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2008 11:02 PM To: Struts Users Mailing List Subject: Re: How to initialize business service objects? For a POJO you can use dependency injection such as Spring or Guice or you can instantiate the object the normal way BusinessServiceObject bso = new BusinessServiceObject(); in your action class. There is nothing special about accessing your BSO's in Struts. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: Frank Fischer [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Thu, 13 Mar 2008 22:32:34 +0100 To: user@struts.apache.org Subject: How to initialize business service objects? Hi all i'm just starting with struts2 (even with struts at all). Of course i first read some how-to-starts. But there is one thing i don't understand. I'm trying to create a simple little chat app. I have two action classes, one for the normal chat user, one for the moderators. Both classes need access to the same instances of business service classes which mainly hold runtime data such as a list of users currently logged in, list of chat rooms and so on. Now i don't understand (1) where to create/initialize these business logic classes and (2) how to get access to them from the action classes. I'm very thankful for any hint. Thanks a lot Frank This email and any attachments (Message) may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] RE: How to initialize business service objects?
--- Frank Fischer [EMAIL PROTECTED] wrote: I just read a bit regarding Spring. As far as i understand its focus is on J2EE appllications. I guess for what i want to do in a first step (my simple chat app) it would be overkill to use Spring. Do i get that right? Not really. IMO Spring is a light-weight(-ish) alternative to true JEE apps (note that it's JEE now, not J2EE :) S2's Spring integration is lightweight to the point of near-invisibility, particularly for simple setups. It's as easy as defining a bean in a Spring configuration file and providing a setter in your S2 action. There are several benefits to doing so, but that's something you can discover on your own if you decide to explore Spring. This particular usage is called Inversion of Control (IoC) or (my preference) Dependency Injection (DI). I just don't understand how can i get access to a BusinessServiceObject created in one of my Action classes from another Action class. Just by declaring it as static? No, by keeping it in session or application scope. I'd recommend getting at least a minimal handle on some basic web application technology and terminology before jumping in *too* deep: S2, like many frameworks, pretty much requires a basic understanding of the fundamentals. Without it it's hard to even know what questions to ask sometimes, and will make the whole process much easier. Second thing i don't understand is, when will action objects be intatiated in the application server? Actions are instantiated per-request. As far as i remember from the early days of servlet programming (when i had to do with this technology the last time) the servlets are intantiated upon the first request. In a normal Servlet based Web app i would have intiantiated BusinessServiceObjects in a filter and placed them to the ServletContext. So i could be sure it's instantiated before the first request arrives and i can get a reference to it from anywhere in my web app. But with Struts i don't see how i could do so. You *could* do it the exact same way: S2 doesn't replace what you know about web applications, it supplements it. That said, it's probably better to perform tasks like that in ServletContextListener (don't quote me on that; I have a notoriously bad memory for anything camelCased) or whatever it's called. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to initialize business service objects?
Hi Frank, Have a read of Martin Fowler's article on deciding which option best suits you: http://martinfowler.com/articles/injection.html As Dave described you have many possibilities, but the common techniques are (not in order of preference): a. Use a ServletContextListener to to setup your services and place them in Application Scope. Look them up from your action b. as per b, but include an interceptor to inject them into your actions based on interfaces (eg.MyServiceAware) c. Setup your business services as Singletons or accessed through a Registry (setup as per a) d. Use an IOC container. Spring and Guice. Guice is simple, elegant and does this single task extremely well; Spring knowledge is a must-have and reflects the community's consensus on best-practice in almost every imaginable aspect of a web application. Hope that helps. Jeromy Evans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 scheduler
thx all, i solve my problem with quartz, i used it with spring thx so much - Original Message From: Peters, John [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, March 12, 2008 10:14:18 PM Subject: RE: Struts 2 scheduler Depends on the implementation. If you only need to run one job every hour, then using an EJB will make life easier than quartz. Now if you need to run multiple jobs on varying days and times, obviously you would use quartz. -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2008 9:42 AM To: Struts Users Mailing List Subject: RE: Struts 2 scheduler --- Peters, John [EMAIL PROTECTED] wrote: What kind of task, database cleanup? Does it occur every minute, hour, day? You might want to consider a stateless session EJB that implements a TimerService. Here are some examples http://www.theserverside.com/tt/articles/article.tss?l=MonsonHaefel-Co lu mn4 http://www.javabeat.net/javabeat/ejb3/articles/timer_services_api_in_e jb _3_0_2.php Quartz isn't really worth the effort for small mundane tasks. But EJB is?! Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Blue Cross Blue Shield of Florida, Inc., and its subsidiary and affiliate companies are not responsible for errors or omissions in this e-mail message. Any personal comments made in this e-mail do not reflect the views of Blue Cross Blue Shield of Florida, Inc. The information contained in this document may be confidential and intended solely for the use of the individual or entity to whom it is addressed. This document may contain material that is privileged or protected from disclosure under applicable law. If you are not the intended recipient or the individual responsible for delivering to the intended recipient, please (1) be advised that any use, dissemination, forwarding, or copying of this document IS STRICTLY PROHIBITED; and (2) notify sender immediately by telephone and destroy the document. THANK YOU. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Re: Getting error in using tag library : The Tag class 'org.apache.struts.taglib.html.FormTag' has no setter method corresponding to TLD declared attribute 'acceptCharset', (JSP 1.1 spec, 5.4.1)
I am using the struts version 1.2.4 Antonio Petrelli-3 wrote: 2008/3/13, kannan_307 [EMAIL PROTECTED]: When I deploying my War file in Weblogic 8.1, I am getting the following error: Error in using tag library uri='/WEB-INF/tlds/struts-html.tld' prefix='html': The Tag class 'org.apache.struts.taglib.html.FormTag' has no setter method corresponding to TLD declared attribute 'acceptCharset', (JSP 1.1 spec, 5.4.1) What version of Struts do you use? Antonio -- View this message in context: http://www.nabble.com/Getting-error-in-using-tag-library-%3A-The-Tag-class-%27org.apache.struts.taglib.html.FormTag%27-has-no-setter-method-corresponding-to-TLD-declared-attribute-%27acceptCharset%27%2C-%28JSP-1.1-spec%2C-5.4.1%29-tp16026918p16044463.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: selective validation using validation.xml
akash agrawal-2 wrote: Hi, Is this possible to do selective validation using validation.xml? What I meant by this is that calling a different set of validation on each(different) invocation of same action and same method. Quite possible: in that case u would write valildation as: ActionClass - action name mentioned in struts.xml-validation.xml. Example: I call UpdateAction and update method and use UpdateAction-validation.xml and want to validate different set of validation of invocation based on my application requirement. 1. Put validation for field A and B in xml file 2. validate field A but not field B on one invocation. 3. validate field B but not field A on other involcation. possible: in fact you can write custom interceptors which finally fill up action errors and field errors to their end. Include this btw validation interceptor and workflow interceptor in your xml file. Thanks, -Akash - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. -- View this message in context: http://www.nabble.com/selective-validation-using-validation.xml-tp15903866p16044494.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Multiple Actions for a single page. Is this possible
hi, We have two pages a.jsp and b.jsp developed with the action class mehods Ac.a() Ac.b() that render these pages. Now we need to develop a new page c.jsp which is combination of both a b.jsps. i can include the jsps into the c.jsp. But what abt the action class behind? can they not get automatically invoked and the pages get populated? More over i have some logic to be performed based on the inputs made in the two sections of c.jsp. Is it possible for me to only do this part as a layer? any ideas as how to go abt this? pl help. regards, ravi -- View this message in context: http://www.nabble.com/Multiple-Actions-for-a-single-page.-Is-this-possible-tp16044652p16044652.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]