Re: Torque and Struts problem
What happens with this instead of JSTL: jsp:useBean id=comptest scope=request type=org.ttemplating.internal.dataobjects.Component/ jsp:getProperty name=comptest property=name/ Paul Daniell wrote: From: Kris Schneider [EMAIL PROTECTED] I suppose this could be a classloader issue. Are all your Struts, Torque, and JSTL JAR files colocated? Yes. I am using Struts 1.1 rc1, Torque 3.0.2, and JSTL 1.0. Quoting Paul Daniell [EMAIL PROTECTED]: I've encountered a strange problem with Struts when used with Torque. I retrieve an object using the following: ArrayList list = (ArrayList)ComponentPeer.doSelect(new Criteria()); request.setAttribute(components, list); Component c = (Component)list.get(0); request.setAttribute(comptest, c); System.out.println(c.getName()); In the logs this will appropriately print the name of the object c. However, when I invoke the following JSP ... htmlbody c:out value=${comptest.name}/ /body/html I get the following Exception: HTTP ERROR: 500 An error occurred while evaluating custom action attribute value with value ${comptest.name}: An error occurred while getting property name from an instance of class org.ttemplating.internal.dataobjects.Component (java.lang.IllegalArgumentException: object is not an instance of declaring class) Any advice appreciated. Paul -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts upload
there is struts upload example in the struts download package u also can use the commons package. Clement - Original Message - From: Edgar Silva [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 7:52 AM Subject: Struts upload Hi Folks... Anybody can send to me any address of docs or articles, talking about Struts uploads. since now... TIA Edgar _ MSN Hotmail, o maior webmail do Brasil. http://www.hotmail.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]
SV: constant url
Hi If you are using a a href or html:link you cannot hide the parameters. The url you'r using should be the path configured in the struts-config. Med venlig hilsen Claus Weng Madsen, Teamleder TELMORE A/S Carl Gustavsgade 3, 2630 Taastrup Telefon 70218700, Mobil 30242875 www.telmore.dk -Oprindelig meddelelse- Fra: shankarr [mailto:[EMAIL PROTECTED] Sendt: 27. januar 2004 07:53 Til: [EMAIL PROTECTED] Emne: constant url hi! whenever i click on any link, my url shows the action name and the parameters being passed. i want to avoid showing this. how to do it? Richie To achieve all that is possible, one must attempt the impossible - 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: Re-deploying in JBoss3.2.3
Try to deploy an extracted .war (as a directory named name.war) -graste -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Monday, January 26, 2004 8:32 PM To: [EMAIL PROTECTED] Subject: Re-deploying in JBoss3.2.3 Importance: High Hi, Can anybody suggest me Is there anyway I can avoid re-deploy the ear file contains war again and again whenever we make changes to JSP's in JBoss 3.2.3 bundle with Tomcat 4.1.29..? earlier we were running separate container(JBoss and Tomcat as different container) and were able to re-deploy the war file without affecting the ear. Thank you in advance. -Ramadoss - 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: constant url
If you want to stop the 'ugly' urls showing in the address bar of the browser, you can have all the contents of the site show in a frame, whose frameset is found at the url you want to show. -Original Message- From: Claus Weng Madsen - TELMORE [mailto:[EMAIL PROTECTED] Sent: Tuesday, 27 January 2004 15:53 To: Struts Users Mailing List Subject: SV: constant url Hi If you are using a a href or html:link you cannot hide the parameters. The url you'r using should be the path configured in the struts-config. Med venlig hilsen Claus Weng Madsen, Teamleder TELMORE A/S Carl Gustavsgade 3, 2630 Taastrup Telefon 70218700, Mobil 30242875 www.telmore.dk -Oprindelig meddelelse- Fra: shankarr [mailto:[EMAIL PROTECTED] Sendt: 27. januar 2004 07:53 Til: [EMAIL PROTECTED] Emne: constant url hi! whenever i click on any link, my url shows the action name and the parameters being passed. i want to avoid showing this. how to do it? Richie To achieve all that is possible, one must attempt the impossible - 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: Torque and Struts problem
The problem is neither with Struts nor Torque but rather with the reflection API, which exhibits strange behavior when asked to deal with classes named Component. Strangely enough, I found a thread on the struts-user thread http://www.mail-archive.com/[EMAIL PROTECTED]/msg60817.html dealing with the same problem. Everything behaves properly when the class is renamed Komponent. PD - Original Message - From: Kris Schneider [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, January 26, 2004 3:14 PM Subject: Re: Torque and Struts problem My email's acting flaky, sorry if this gets posted twice: What happens with this instead of JSTL: jsp:useBean id=comptest scope=request type=org.ttemplating.internal.dataobjects.Component/ jsp:getProperty name=comptest property=name/ Paul Daniell wrote: From: Kris Schneider [EMAIL PROTECTED] I suppose this could be a classloader issue. Are all your Struts, Torque, and JSTL JAR files colocated? Yes. I am using Struts 1.1 rc1, Torque 3.0.2, and JSTL 1.0. Quoting Paul Daniell [EMAIL PROTECTED]: I've encountered a strange problem with Struts when used with Torque. I retrieve an object using the following: ArrayList list = (ArrayList)ComponentPeer.doSelect(new Criteria()); request.setAttribute(components, list); Component c = (Component)list.get(0); request.setAttribute(comptest, c); System.out.println(c.getName()); In the logs this will appropriately print the name of the object c. However, when I invoke the following JSP ... htmlbody c:out value=${comptest.name}/ /body/html I get the following Exception: HTTP ERROR: 500 An error occurred while evaluating custom action attribute value with value ${comptest.name}: An error occurred while getting property name from an instance of class org.ttemplating.internal.dataobjects.Component (java.lang.IllegalArgumentException: object is not an instance of declaring class) Any advice appreciated. Paul -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.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: constant url
Hi! Thanks for the response. http://localhost:8081/log4jdemo/loginScreen.do is what I see in my url. I would like to keep this a constant at http://localhost:8081/log4jdemo only. I am using both a href and html:link. But, even in cases where i use direct action like /loginScreen.do, on invoking the action, i.e clicking a button, i get the full path in the url. This exposes the data to the hackers and will be a big issue in deployment. Any help will be appreciated. Richie At 04:14 PM 1/27/2004 +0800, you wrote: If you want to stop the 'ugly' urls showing in the address bar of the browser, you can have all the contents of the site show in a frame, whose frameset is found at the url you want to show. -Original Message- From: Claus Weng Madsen - TELMORE [mailto:[EMAIL PROTECTED] Sent: Tuesday, 27 January 2004 15:53 To: Struts Users Mailing List Subject: SV: constant url Hi If you are using a a href or html:link you cannot hide the parameters. The url you'r using should be the path configured in the struts-config. Med venlig hilsen Claus Weng Madsen, Teamleder TELMORE A/S Carl Gustavsgade 3, 2630 Taastrup Telefon 70218700, Mobil 30242875 www.telmore.dk -Oprindelig meddelelse- Fra: shankarr [mailto:[EMAIL PROTECTED] Sendt: 27. januar 2004 07:53 Til: [EMAIL PROTECTED] Emne: constant url hi! whenever i click on any link, my url shows the action name and the parameters being passed. i want to avoid showing this. how to do it? Richie To achieve all that is possible, one must attempt the impossible - 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 achieve all that is possible, one must attempt the impossible - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: constant url
Hi Shankarr Your best choice will be frames...that way you can hide the details of your navigation to the end user. But frames has some disadvantages, tooIt is somehow a pro/con situation where you have to decide if you can live with request parameters or not... Regarding the hacker-threat...hmm manu sites use request parameters...and there are other ways to make the site secure... Hope that did help - Original Message - From: shankarr [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 9:47 AM Subject: RE: constant url Hi! Thanks for the response. http://localhost:8081/log4jdemo/loginScreen.do is what I see in my url. I would like to keep this a constant at http://localhost:8081/log4jdemo only. I am using both a href and html:link. But, even in cases where i use direct action like /loginScreen.do, on invoking the action, i.e clicking a button, i get the full path in the url. This exposes the data to the hackers and will be a big issue in deployment. Any help will be appreciated. Richie At 04:14 PM 1/27/2004 +0800, you wrote: If you want to stop the 'ugly' urls showing in the address bar of the browser, you can have all the contents of the site show in a frame, whose frameset is found at the url you want to show. -Original Message- From: Claus Weng Madsen - TELMORE [mailto:[EMAIL PROTECTED] Sent: Tuesday, 27 January 2004 15:53 To: Struts Users Mailing List Subject: SV: constant url Hi If you are using a a href or html:link you cannot hide the parameters. The url you'r using should be the path configured in the struts-config. Med venlig hilsen Claus Weng Madsen, Teamleder TELMORE A/S Carl Gustavsgade 3, 2630 Taastrup Telefon 70218700, Mobil 30242875 www.telmore.dk -Oprindelig meddelelse- Fra: shankarr [mailto:[EMAIL PROTECTED] Sendt: 27. januar 2004 07:53 Til: [EMAIL PROTECTED] Emne: constant url hi! whenever i click on any link, my url shows the action name and the parameters being passed. i want to avoid showing this. how to do it? Richie To achieve all that is possible, one must attempt the impossible - 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 achieve all that is possible, one must attempt the impossible - 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 upload
Hi Edgar Check out the demo applications in the Struts distribution (source code I guess). There is a wonderful simple example there dealing with uploads.. HTH /Henrik - Original Message - From: Edgar Silva [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 12:52 AM Subject: Struts upload Hi Folks... Anybody can send to me any address of docs or articles, talking about Struts uploads. since now... TIA Edgar _ MSN Hotmail, o maior webmail do Brasil. http://www.hotmail.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]
WebGroups css
Hi you, I do have a silly problem with style sheets-linking. I have a css-File in the folder /theme/formats.css. I access this file from a jsp-page of the folder /help/info.jsp with this link: LINK href=../theme/formats.css rel=stylesheet type=text/css This works, if I call the jsp-Page directly. There is another jsp-page in the folder called /help/infoTest.jsp. This page is called from struts-config with a forward. The page has exactly the same code for linking the css-File. But when the jsp-Page is called, the css-File is not found and the server is showing this message: Web group /theme/formats.css is not defined (Die Webgruppe /theme/formats.css wurde nicht definiert.) Does anybody have an idea how to solve this problem? Manuel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
retrieve url of prior visited site (inside struts)
Hello, how is it possible to get the url of the prior visited site ? I have a struts application which has page with a back button using the javascript:history.go(-1) function. On this page a session could be created, which would be lost when going back using the javascript function. How do I get the prior url with all parameters ? Thx berger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: WebGroups css
Hi, you can do this in this way (static path to css file): % String context_path = request.getContextPath(); % LINK href=%=context_path%/theme/formats.css rel=stylesheet type=text/css Regards, Frank -Ursprungliche Nachricht- Von: Manuel Lenz [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 27. Januar 2004 09:15 An: Struts Users Mailing List Betreff: WebGroups css Hi you, I do have a silly problem with style sheets-linking. I have a css-File in the folder /theme/formats.css. I access this file from a jsp-page of the folder /help/info.jsp with this link: LINK href=../theme/formats.css rel=stylesheet type=text/css This works, if I call the jsp-Page directly. There is another jsp-page in the folder called /help/infoTest.jsp. This page is called from struts-config with a forward. The page has exactly the same code for linking the css-File. But when the jsp-Page is called, the css-File is not found and the server is showing this message: Web group /theme/formats.css is not defined (Die Webgruppe /theme/formats.css wurde nicht definiert.) Does anybody have an idea how to solve this problem? Manuel - 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: Session Problem
put [EMAIL PROTECTED] contentType=text/html session=false% or %@ page session=false % In the header of your jsp that you dont want caching. Chris -Original Message- From: VERMA, SANJEEV (SBCSI) [mailto:[EMAIL PROTECTED] Sent: 26 January 2004 18:33 To: 'Struts Users Mailing List' Subject: RE: Session Problem Initially I thought the same way, but it is happening between different Machines. Looks like this is some kind of caching problem but couldn't figure it out where. -Original Message- From: Robert Nocera [mailto:[EMAIL PROTECTED] Sent: Monday, January 26, 2004 12:40 PM To: 'Struts Users Mailing List' Subject: RE: Session Problem If there is no server activity, is it possible the page you are looking at is cached? -Rob -Original Message- From: VERMA, SANJEEV (SBCSI) [mailto:[EMAIL PROTECTED] Sent: Monday, January 26, 2004 12:24 PM To: [EMAIL PROTECTED] Subject: Re: Session Problem I put the topic as Re: Session Problem because it may be related with same problem. In my application I am using Struts 1.1 and WebSphere 5.0. First time when I login into the application it works fine. The problem starts after that, when I open a new browser not by Ctrl+N or File--New--Window, but I start a new Browser from my Windows 2000 Start randomly I found myself auto logged in to my application and it happens like 1 in 10 times only. The strange thing is even when I logged-in on my machine, if I open the login page from other's machine also the same problem happens. Irrespective of from where I go to login page randomly I found myself logged-in. It is not like it happens just with my ID, it happens with anybody's ID. And whenever that auto-login happens , it doesn't show any activity on server(I check log files for that). It is really a weird problem, if anybody has faced similar kind of problem, please let me know. By the way the WebSphere 5.0 is on AIX box. Your help will be appreciated. Regards Sanjeev - 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] *** This e-mail and its attachments are confidential and are intended for the above named recipient only. If this has come to you in error, please notify the sender immediately and delete this e-mail from your system. You must take no action based on this, nor must you copy or disclose it or any part of its contents to any person or organisation. Statements and opinions contained in this email may not necessarily represent those of Littlewoods. Please note that e-mail communications may be monitored. The registered office of Littlewoods Limited and its subsidiaries is 100 Old Hall Street, Liverpool, L70 1AB. Registered number of Littlewoods Limited is 262152. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: WebGroups css
Try using an html:base tag in your jsp. (See the docs for details , I forget the syntax) -Original Message- From: Manuel Lenz [mailto:[EMAIL PROTECTED] Sent: Tuesday, 27 January 2004 16:15 To: Struts Users Mailing List Subject: WebGroups css Hi you, I do have a silly problem with style sheets-linking. I have a css-File in the folder /theme/formats.css. I access this file from a jsp-page of the folder /help/info.jsp with this link: LINK href=../theme/formats.css rel=stylesheet type=text/css This works, if I call the jsp-Page directly. There is another jsp-page in the folder called /help/infoTest.jsp. This page is called from struts-config with a forward. The page has exactly the same code for linking the css-File. But when the jsp-Page is called, the css-File is not found and the server is showing this message: Web group /theme/formats.css is not defined (Die Webgruppe /theme/formats.css wurde nicht definiert.) Does anybody have an idea how to solve this problem? Manuel - 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: constant url
- Original Message - From: shankarr [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 3:47 AM Subject: RE: constant url Hi! Thanks for the response. http://localhost:8081/log4jdemo/loginScreen.do is what I see in my url. I would like to keep this a constant at http://localhost:8081/log4jdemo only. I am using both a href and html:link. Have you seen what DispatchAction can do for you? But, even in cases where i use direct action like /loginScreen.do, on invoking the action, i.e clicking a button, i get the full path in the url. Yes, and that bothers you? This exposes the data to the hackers and will be a big issue in deployment. WHAT?!?!? Expose what to hackers? The HTTP request string? If you want to get away from HTTP request string, you need to get away from HTTP. Your closest option is to POST everything, but that still leaves you vulnerable. I could (if I were sniffing your network) capture and read a POST as easily as I could a GET. Consider using SSL. Any help will be appreciated. Richie -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 (cell) AIM: jmitchtx MSN: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WebGroups css
I've found this to be the cleanest way (aside from using a custom tag): head ... ... style type=text/css media=screen @import url(html:rewrite page=/stylesheets/style.css /); /style /head The benefits here are: * The URL is relative to the root of the server. An application named myapp will resolve to /myapp/stylesheets/style.css. So this will work from anywhere in the application, no matter what the address bar shows. * no scriplet * no nested xml-like syntax ...anyway...just my $.02 -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 (cell) AIM: jmitchtx MSN: [EMAIL PROTECTED] - Original Message - From: Otto, Frank [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 5:10 AM Subject: AW: WebGroups css Hi, you can do this in this way (static path to css file): % String context_path = request.getContextPath(); % LINK href=%=context_path%/theme/formats.css rel=stylesheet type=text/css Regards, Frank -Ursprungliche Nachricht- Von: Manuel Lenz [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 27. Januar 2004 09:15 An: Struts Users Mailing List Betreff: WebGroups css Hi you, I do have a silly problem with style sheets-linking. I have a css-File in the folder /theme/formats.css. I access this file from a jsp-page of the folder /help/info.jsp with this link: LINK href=../theme/formats.css rel=stylesheet type=text/css This works, if I call the jsp-Page directly. There is another jsp-page in the folder called /help/infoTest.jsp. This page is called from struts-config with a forward. The page has exactly the same code for linking the css-File. But when the jsp-Page is called, the css-File is not found and the server is showing this message: Web group /theme/formats.css is not defined (Die Webgruppe /theme/formats.css wurde nicht definiert.) Does anybody have an idea how to solve this problem? Manuel - 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: constant url
use ssl or create an outer html-doc containing one frame in that frame call your struts-application. In the address-field of the browser you will only see the url with which you call the outer html-doc... Still leaves you vulnerable to a skilled hacker, but protects the url from tha standard users... On clickable links specify alt-texts and write something to the browsers status-line, else the link-address will be shown there... hth Alexander -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED] Sent: Dienstag, 27. Januar 2004 12:43 To: Struts Users Mailing List Subject: Re: constant url - Original Message - From: shankarr [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 3:47 AM Subject: RE: constant url Hi! Thanks for the response. http://localhost:8081/log4jdemo/loginScreen.do is what I see in my url. I would like to keep this a constant at http://localhost:8081/log4jdemo only. I am using both a href and html:link. Have you seen what DispatchAction can do for you? But, even in cases where i use direct action like /loginScreen.do, on invoking the action, i.e clicking a button, i get the full path in the url. Yes, and that bothers you? This exposes the data to the hackers and will be a big issue in deployment. WHAT?!?!? Expose what to hackers? The HTTP request string? If you want to get away from HTTP request string, you need to get away from HTTP. Your closest option is to POST everything, but that still leaves you vulnerable. I could (if I were sniffing your network) capture and read a POST as easily as I could a GET. Consider using SSL. Any help will be appreciated. Richie -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 (cell) AIM: jmitchtx MSN: [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: Torque and Struts problem
This appears to be fixed in Sun's 1.4.2. A quick test failed with 1.4.1_06-b01 but passed with 1.4.2_03-b02. Quoting P. Daniell [EMAIL PROTECTED]: The problem is neither with Struts nor Torque but rather with the reflection API, which exhibits strange behavior when asked to deal with classes named Component. Strangely enough, I found a thread on the struts-user thread http://www.mail-archive.com/[EMAIL PROTECTED]/msg60817.html dealing with the same problem. Everything behaves properly when the class is renamed Komponent. PD - Original Message - From: Kris Schneider [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, January 26, 2004 3:14 PM Subject: Re: Torque and Struts problem My email's acting flaky, sorry if this gets posted twice: What happens with this instead of JSTL: jsp:useBean id=comptest scope=request type=org.ttemplating.internal.dataobjects.Component/ jsp:getProperty name=comptest property=name/ Paul Daniell wrote: From: Kris Schneider [EMAIL PROTECTED] I suppose this could be a classloader issue. Are all your Struts, Torque, and JSTL JAR files colocated? Yes. I am using Struts 1.1 rc1, Torque 3.0.2, and JSTL 1.0. Quoting Paul Daniell [EMAIL PROTECTED]: I've encountered a strange problem with Struts when used with Torque. I retrieve an object using the following: ArrayList list = (ArrayList)ComponentPeer.doSelect(new Criteria()); request.setAttribute(components, list); Component c = (Component)list.get(0); request.setAttribute(comptest, c); System.out.println(c.getName()); In the logs this will appropriately print the name of the object c. However, when I invoke the following JSP ... htmlbody c:out value=${comptest.name}/ /body/html I get the following Exception: HTTP ERROR: 500 An error occurred while evaluating custom action attribute value with value ${comptest.name}: An error occurred while getting property name from an instance of class org.ttemplating.internal.dataobjects.Component (java.lang.IllegalArgumentException: object is not an instance of declaring class) Any advice appreciated. Paul -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WebGroups css
The best choice is to use html:rewrite :) i m with james - Original Message - From: James Mitchell [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 1:06 PM Subject: Re: WebGroups css I've found this to be the cleanest way (aside from using a custom tag): head ... ... style type=text/css media=screen @import url(html:rewrite page=/stylesheets/style.css /); /style /head The benefits here are: * The URL is relative to the root of the server. An application named myapp will resolve to /myapp/stylesheets/style.css. So this will work from anywhere in the application, no matter what the address bar shows. * no scriplet * no nested xml-like syntax ...anyway...just my $.02 -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 (cell) AIM: jmitchtx MSN: [EMAIL PROTECTED] - Original Message - From: Otto, Frank [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 5:10 AM Subject: AW: WebGroups css Hi, you can do this in this way (static path to css file): % String context_path = request.getContextPath(); % LINK href=%=context_path%/theme/formats.css rel=stylesheet type=text/css Regards, Frank -Ursprungliche Nachricht- Von: Manuel Lenz [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 27. Januar 2004 09:15 An: Struts Users Mailing List Betreff: WebGroups css Hi you, I do have a silly problem with style sheets-linking. I have a css-File in the folder /theme/formats.css. I access this file from a jsp-page of the folder /help/info.jsp with this link: LINK href=../theme/formats.css rel=stylesheet type=text/css This works, if I call the jsp-Page directly. There is another jsp-page in the folder called /help/infoTest.jsp. This page is called from struts-config with a forward. The page has exactly the same code for linking the css-File. But when the jsp-Page is called, the css-File is not found and the server is showing this message: Web group /theme/formats.css is not defined (Die Webgruppe /theme/formats.css wurde nicht definiert.) Does anybody have an idea how to solve this problem? Manuel - 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: constant url
Hi! Thanks again for the responses. Yes, I do plan to implement ssl for security. Thanks again, Richie At 01:07 PM 1/27/2004 +0100, you wrote: use ssl or create an outer html-doc containing one frame in that frame call your struts-application. In the address-field of the browser you will only see the url with which you call the outer html-doc... Still leaves you vulnerable to a skilled hacker, but protects the url from tha standard users... On clickable links specify alt-texts and write something to the browsers status-line, else the link-address will be shown there... hth Alexander -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED] Sent: Dienstag, 27. Januar 2004 12:43 To: Struts Users Mailing List Subject: Re: constant url - Original Message - From: shankarr [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 3:47 AM Subject: RE: constant url Hi! Thanks for the response. http://localhost:8081/log4jdemo/loginScreen.do is what I see in my url. I would like to keep this a constant at http://localhost:8081/log4jdemo only. I am using both a href and html:link. Have you seen what DispatchAction can do for you? But, even in cases where i use direct action like /loginScreen.do, on invoking the action, i.e clicking a button, i get the full path in the url. Yes, and that bothers you? This exposes the data to the hackers and will be a big issue in deployment. WHAT?!?!? Expose what to hackers? The HTTP request string? If you want to get away from HTTP request string, you need to get away from HTTP. Your closest option is to POST everything, but that still leaves you vulnerable. I could (if I were sniffing your network) capture and read a POST as easily as I could a GET. Consider using SSL. Any help will be appreciated. Richie -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 678.910.8017 (cell) AIM: jmitchtx MSN: [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 achieve all that is possible, one must attempt the impossible - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Best Practices question
What is considered the best way for a business bean to handle errors so that they eventually get to ActionErrors? And what about business logging? Thanks, jim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Setting iinitial values for Integer[] in a dynaActionForm
I can set initial values for String[] in a dynaActionForm in the struts-config.xml however when I try to set initial values for Integer[] I get the following error: 2004-01-26 13:40:49,224 [ERROR] RequestUtils: Error creating form bean of class org.apache.struts.validator.DynaValidatorForm org.apache.commons.beanutils.ConversionException: Cannot assign value of type 'java.lang.String' to property 'ids' of type '[Ljava.lang.Integer;' Config extract: form-bean name=form type=org.apache.struts.validator.DynaValidatorForm form-property name=id type=java.lang.String/ form-property name=name type=java.lang.String/ form-property name=ids type=java.lang.Integer[] initial=0/ form-property name=countries type=java.lang.String[] initial=UK/ /form-bean Can someone please tell me where to look to do this or how to change my struts config. Thanks Claire E-mail is an informal method of communication and may be subject to data corruption, interception and unauthorised amendment for which Digital Bridges Ltd will accept no liability. Therefore, it will normally be inappropriate to rely on information contained on e-mail without obtaining written confirmation. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Manually placing errors for display
Isn't it still logic:messagesPresent message=true html:messages id=message message=true bean:write name=message/br /html:messages /logic:messagesPresent - for messages, and logic:messagesPresent html:messages id=error bean:write name=error/br /html:messages /logic:messagesPresent - for errors? Then for messages for individual properties, the property attribute for html:messages is used. If these ain't it, can somebody post what is? --- Wendy Smoak [EMAIL PROTECTED] wrote: Seems there's been a lot of back and forth over ActionError/ActionMessage and I'm a bit confused. I've also been using Validator, so I don't manually create error messages very often. Using a recent nightly build, say I've called some DAO method in my Action code and something has gone wrong. What's the latest simple, clean way to place an error message/key where it belongs so that it will get displayed on the form? (It's not necessarily related to a form field.) Thanks, -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validation Multiple Pages forward-Failure
Hello, I have a MultiPageFrom with 7 seperate JSP-Pages. I want to validate all these pages. When I run the application and whould test if the validation works well, I get the following error when I hit Submit. --- type Status report message No input attribute for mapping path /newUser description The server encountered an internal error (No input attribute for mapping path /newUser) that prevented it from fulfilling this request. --- When validate is false, it works correctly, without validation. No validation is not a solution. Some more information: NewUserAktion snippet: ... ActionErrors errors = newUserFrom.validate(mapping, request); if (errors != null errros.isEmpty()){ if (newUserFrom.getPage() == 1) return mapping.findForward(user2); ... if (newUserFrom.getPage() == 7) return mapping.findForward(success); } else { saveErrors(request, errors); if (newUserFrom.getPage() == 1) return mapping.findForward(user+newUserFrom.getPage()); if (newUserFrom.getPage() == 2) return mapping.findForward(user+newUserForm.getPage()); ... } struts-config snippet: ... action attribute=newUserFrom name=newUserFrom path=/newUser scope=session type=... validate=true forward name=success path=/index.html redirect=false contextRelative=false/ forward name=user1 path=newuser/index.jsp redirect=false contextRealtive=false/ ... /action newuser/index.jsp snippet: ... logic:messagesPresent html:messages id=error bean:write name=error/ /html:messages /logic:messagesPresent html:form action=newUser html:hidden property=action/ html:hidden property=page value=1/ ... /html:form I don's see any problem, wheres my failure? Thx Robert Lehner [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validation Multiple Pages forward-Failure
Hello, I have a MultiPageFrom with 7 seperate JSP-Pages. I want to validate all these pages. When I run the application and whould test if the validation works well, I get the following error when I hit Submit. --- type Status report message No input attribute for mapping path /newUser description The server encountered an internal error (No input attribute for mapping path /newUser) that prevented it from fulfilling this request. --- When validate is false, it works correctly, without validation. No validation is not a solution. Some more information: NewUserAktion snippet: ... ActionErrors errors = newUserFrom.validate(mapping, request); if (errors != null errros.isEmpty()){ if (newUserFrom.getPage() == 1) return mapping.findForward(user2); ... if (newUserFrom.getPage() == 7) return mapping.findForward(success); } else { saveErrors(request, errors); if (newUserFrom.getPage() == 1) return mapping.findForward(user+newUserFrom.getPage()); if (newUserFrom.getPage() == 2) return mapping.findForward(user+newUserForm.getPage()); ... } struts-config snippet: ... action attribute=newUserFrom name=newUserFrom path=/newUser scope=session type=... validate=true forward name=success path=/index.html redirect=false contextRelative=false/ forward name=user1 path=newuser/index.jsp redirect=false contextRealtive=false/ ... /action newuser/index.jsp snippet: ... logic:messagesPresent html:messages id=error bean:write name=error/ /html:messages /logic:messagesPresent html:form action=newUser html:hidden property=action/ html:hidden property=page value=1/ ... /html:form I don's see any problem, wheres my failure? Thx Robert Lehner [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation Multiple Pages forward-Failure
struts validation uses the input attribute of the action tag to send you back to where you came from if validation fails. Here's the excerpt from the dtd: input Module-relative path of the action or other resource to which control should be returned if a validation error is encountered. Valid only when name is specified. Required if name is specified and the input bean returns validation errors. Optional if name is specified and the input bean does not return validation errors you must specify this attribute if you want to use struts validation. -Ben From: Robert Lehner [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Validation Multiple Pages forward-Failure Date: Tue, 27 Jan 2004 14:01:16 +0100 Hello, I have a MultiPageFrom with 7 seperate JSP-Pages. I want to validate all these pages. When I run the application and whould test if the validation works well, I get the following error when I hit Submit. --- type Status report message No input attribute for mapping path /newUser description The server encountered an internal error (No input attribute for mapping path /newUser) that prevented it from fulfilling this request. --- When validate is false, it works correctly, without validation. No validation is not a solution. Some more information: NewUserAktion snippet: ... ActionErrors errors = newUserFrom.validate(mapping, request); if (errors != null errros.isEmpty()){ if (newUserFrom.getPage() == 1) return mapping.findForward(user2); ... if (newUserFrom.getPage() == 7) return mapping.findForward(success); } else { saveErrors(request, errors); if (newUserFrom.getPage() == 1) return mapping.findForward(user+newUserFrom.getPage()); if (newUserFrom.getPage() == 2) return mapping.findForward(user+newUserForm.getPage()); ... } struts-config snippet: ... action attribute=newUserFrom name=newUserFrom path=/newUser scope=session type=... validate=true forward name=success path=/index.html redirect=false contextRelative=false/ forward name=user1 path=newuser/index.jsp redirect=false contextRealtive=false/ ... /action newuser/index.jsp snippet: ... logic:messagesPresent html:messages id=error bean:write name=error/ /html:messages /logic:messagesPresent html:form action=newUser html:hidden property=action/ html:hidden property=page value=1/ ... /html:form I don's see any problem, wheres my failure? Thx Robert Lehner [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ High-speed usersbe more efficient online with the new MSN Premium Internet Software. http://join.msn.com/?pgmarket=en-uspage=byoa/premST=1 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation Multiple Pages forward-Failure
Hello I saw this in the dtd, but I don't knowe what I should enter as value of input. I tried newUser, newUser.do, newUserFrom nothing worked es expected. I would to get back the form where the validation find the failure, so the User could corret his failure an procced the applikation. BTW: I used the struts-validation exmaple as pattern. I changed in the pattern struts-config.xml at the action multiRegistration the validation to true and the applikation dosen't work any more. Why? Thx Robert Lehner Ben Anderson wrote: struts validation uses the input attribute of the action tag to send you back to where you came from if validation fails. Here's the excerpt from the dtd: input Module-relative path of the action or other resource to which control should be returned if a validation error is encountered. Valid only when name is specified. Required if name is specified and the input bean returns validation errors. Optional if name is specified and the input bean does not return validation errors you must specify this attribute if you want to use struts validation. -Ben From: Robert Lehner [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Validation Multiple Pages forward-Failure Date: Tue, 27 Jan 2004 14:01:16 +0100 Hello, I have a MultiPageFrom with 7 seperate JSP-Pages. I want to validate all these pages. When I run the application and whould test if the validation works well, I get the following error when I hit Submit. --- type Status report message No input attribute for mapping path /newUser description The server encountered an internal error (No input attribute for mapping path /newUser) that prevented it from fulfilling this request. --- When validate is false, it works correctly, without validation. No validation is not a solution. Some more information: NewUserAktion snippet: ... ActionErrors errors = newUserFrom.validate(mapping, request); if (errors != null errros.isEmpty()){ if (newUserFrom.getPage() == 1) return mapping.findForward(user2); ... if (newUserFrom.getPage() == 7) return mapping.findForward(success); } else { saveErrors(request, errors); if (newUserFrom.getPage() == 1) return mapping.findForward(user+newUserFrom.getPage()); if (newUserFrom.getPage() == 2) return mapping.findForward(user+newUserForm.getPage()); ... } struts-config snippet: ... action attribute=newUserFrom name=newUserFrom path=/newUser scope=session type=... validate=true forward name=success path=/index.html redirect=false contextRelative=false/ forward name=user1 path=newuser/index.jsp redirect=false contextRealtive=false/ ... /action newuser/index.jsp snippet: ... logic:messagesPresent html:messages id=error bean:write name=error/ /html:messages /logic:messagesPresent html:form action=newUser html:hidden property=action/ html:hidden property=page value=1/ ... /html:form I don's see any problem, wheres my failure? Thx Robert Lehner [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ High-speed usersbe more efficient online with the new MSN Premium Internet Software. http://join.msn.com/?pgmarket=en-uspage=byoa/premST=1 - 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: Manually placing errors for display
From: Hubert Rabago [mailto:[EMAIL PROTECTED] If these ain't it, can somebody post what is? Thanks! I'm looking for the Java code that goes in the Action to manually put an error in for display when you forward to the form. I have this in another app, but is this right for errors? I'm sure I copied it from somewhere... ActionMessages actionMessages = new ActionMessages(); actionMessages.add( ActionMessages.GLOBAL_MESSAGE, new ActionMessage( error.no.contact.found ) ); saveMessages( request, actionMessages ); return mapping.findForward( failure ); -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation Multiple Pages forward-Failure
You want to put validate=true for the action you are submitting to. That's also where you specify the input. The input is an application relative path beginning with a /, so if you're using /do/* mapping in your web.xml you'd want something like this action name=newUserFrom path=/nextPathInProcess validate=true input=/do/newUser however, I think it's generally best to just forward back to the jsp: input=/pages/newUser.jsp -Ben From: Robert Lehner [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Validation Multiple Pages forward-Failure Date: Tue, 27 Jan 2004 18:19:18 +0100 Hello I saw this in the dtd, but I don't knowe what I should enter as value of input. I tried newUser, newUser.do, newUserFrom nothing worked es expected. I would to get back the form where the validation find the failure, so the User could corret his failure an procced the applikation. BTW: I used the struts-validation exmaple as pattern. I changed in the pattern struts-config.xml at the action multiRegistration the validation to true and the applikation dosen't work any more. Why? Thx Robert Lehner Ben Anderson wrote: struts validation uses the input attribute of the action tag to send you back to where you came from if validation fails. Here's the excerpt from the dtd: input Module-relative path of the action or other resource to which control should be returned if a validation error is encountered. Valid only when name is specified. Required if name is specified and the input bean returns validation errors. Optional if name is specified and the input bean does not return validation errors you must specify this attribute if you want to use struts validation. -Ben From: Robert Lehner [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Validation Multiple Pages forward-Failure Date: Tue, 27 Jan 2004 14:01:16 +0100 Hello, I have a MultiPageFrom with 7 seperate JSP-Pages. I want to validate all these pages. When I run the application and whould test if the validation works well, I get the following error when I hit Submit. --- type Status report message No input attribute for mapping path /newUser description The server encountered an internal error (No input attribute for mapping path /newUser) that prevented it from fulfilling this request. --- When validate is false, it works correctly, without validation. No validation is not a solution. Some more information: NewUserAktion snippet: ... ActionErrors errors = newUserFrom.validate(mapping, request); if (errors != null errros.isEmpty()){ if (newUserFrom.getPage() == 1) return mapping.findForward(user2); ... if (newUserFrom.getPage() == 7) return mapping.findForward(success); } else { saveErrors(request, errors); if (newUserFrom.getPage() == 1) return mapping.findForward(user+newUserFrom.getPage()); if (newUserFrom.getPage() == 2) return mapping.findForward(user+newUserForm.getPage()); ... } struts-config snippet: ... action attribute=newUserFrom name=newUserFrom path=/newUser scope=session type=... validate=true forward name=success path=/index.html redirect=false contextRelative=false/ forward name=user1 path=newuser/index.jsp redirect=false contextRealtive=false/ ... /action newuser/index.jsp snippet: ... logic:messagesPresent html:messages id=error bean:write name=error/ /html:messages /logic:messagesPresent html:form action=newUser html:hidden property=action/ html:hidden property=page value=1/ ... /html:form I don's see any problem, wheres my failure? Thx Robert Lehner [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ High-speed usersbe more efficient online with the new MSN Premium Internet Software. http://join.msn.com/?pgmarket=en-uspage=byoa/premST=1 - 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] _ Check out the new MSN 9 Dial-up fast reliable Internet access with prime features! http://join.msn.com/?pgmarket=en-uspage=dialup/homeST=1 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
multiple validations on one page
Hi all. Still no answer to my other question regarding entities in tiles-defs.xml but now I have another question. I have 2 forms on the same page. I want javascript validations to work for both forms, but it's not happening. It looks like the first form is using the required() function from the second form instead of its own. The second form's javascript validation works just fine though. Anybody know of a way around this? Thanks, Matt Bathje - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
global forwards in modules
Hi again - yet another question from me, sorry. I am trying to have the admin area of my project use modules, but so far it is a no go. I setup the module as: init-param param-nameconfig/admin/param-name param-value/WEB-INF/struts-config-admin.xml/param-value /init-param and if I type urls under /admin/ into the location bar, they work. If I try to use any of the global forwards I have defined in struts-config-admin.xml though, they do not. This becomes a problem rapidly, because (like good struts users) all of our javascript, style sheets, etc. are setup as global forwards, and the index.jsp page under the /admin/ directory has logic:redirect forward=adminLogin/ Any idea why the forwards aren't being followed, and how to correct the problem? I have tried changing that to forward=/admin/adminLogin and that didn't help either. Right now the forwards are setup like the following: forward name=adminLogin path=/login.do / I have tried changing it to name=/admin/adminLogin, path=/admin/login.do, and messing around with the contextRelative attribute, and nothing seems to help - it always says it can't find the forward. Any help would be greatly appreciated. Thanks again, Matt Bathje - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using ApplicationResources and changing Locale
Hello I've got a strange behavior when using ApplicationResources: In web.xml I've defined the following: init-param param-nameapplication/param-name param-valuech.mera.pvs.common.Resource/param-value /init-param I've got two resource.properties (in both resources are the same properties): - Resource.properties (where i've defined all the Constants for english-support - this is the default language, when there's no standard-language defined in browser) - Resource_de.properties (where i've defined all the Constants for german-support) For Changing the language, I've got the follwoing action: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Logger logger = Logger.getLogger(this.getClass().getName()); logger.debug(Start ChangeLocaleAction.java); String parameter = request.getParameter(parameter); String forward = request.getParameter(forward); HttpSession session = request.getSession(); Locale locale = null; if (de.equals(parameter)) { locale = new Locale(de, CH ); } else { locale = new Locale(en, US ); } setLocale(request, locale); session.setAttribute(Globals.LOCALE_KEY, locale); return mapping.findForward(forward); } } Now the strange behavior: When i click on the change-language button (the change-language-action is executed), setLocale() ist not changing all the Language-Constants correctly. Sometimes ist works, sometimes it doesn't work and somtimes struts is mixing the Locales (one property in German, the other in English)... Now I rearranged my Properties like that: - Resource_en.properties - Resource_de.properties ...I changed the name of Resource.properties to Resource_en.properties. Now changing the Language works fine... BUT why??? Shouldn't it work properly like I've defined my properties the first way? I thought, Struts is taking the Resource.properties (definition in web.xml) as the standart-property when there's no language defined in the browser... In my case, Struts is now taking the Resource_de.properties as standard-property. Probably because de comes before en (alphabetically). How can I define Resource_en.properties as standard-property? Or did I do something completly wrong it programming the change Language Action? Many Thanks and greetings Ralph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts upload
hhlow [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] there is struts upload example in the struts download package u also can use the commons package. You should avoid using Commons FileUpload yourself in a Struts application. You'll only run into problems. File upload functionality is built into Struts, and Struts itself uses Commons FileUpload. If you try to add another layer of file upload functionality, you'll find yourself running into problems with streams that have already been consumed by Struts. -- Martin Cooper Clement - Original Message - From: Edgar Silva [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 7:52 AM Subject: Struts upload Hi Folks... Anybody can send to me any address of docs or articles, talking about Struts uploads. since now... TIA Edgar _ MSN Hotmail, o maior webmail do Brasil. http://www.hotmail.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: Validation Multiple Pages forward-Failure
Robert, is there a reason, why you dont use DynaValidatorActionForm ? you can define in validator.xml which attributes a needed for e.g. /submit2 -- formset form name=/submit2 field depends=required,email property=email ... greetings, matthias -Original Message- From: Ben Anderson [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 5:59 PM To: [EMAIL PROTECTED] Subject: RE: Validation Multiple Pages forward-Failure struts validation uses the input attribute of the action tag to send you back to where you came from if validation fails. Here's the excerpt from the dtd: input Module-relative path of the action or other resource to which control should be returned if a validation error is encountered. Valid only when name is specified. Required if name is specified and the input bean returns validation errors. Optional if name is specified and the input bean does not return validation errors you must specify this attribute if you want to use struts validation. -Ben From: Robert Lehner [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Validation Multiple Pages forward-Failure Date: Tue, 27 Jan 2004 14:01:16 +0100 Hello, I have a MultiPageFrom with 7 seperate JSP-Pages. I want to validate all these pages. When I run the application and whould test if the validation works well, I get the following error when I hit Submit. --- type Status report message No input attribute for mapping path /newUser description The server encountered an internal error (No input attribute for mapping path /newUser) that prevented it from fulfilling this request. --- When validate is false, it works correctly, without validation. No validation is not a solution. Some more information: NewUserAktion snippet: ... ActionErrors errors = newUserFrom.validate(mapping, request); if (errors != null errros.isEmpty()){ if (newUserFrom.getPage() == 1) return mapping.findForward(user2); ... if (newUserFrom.getPage() == 7) return mapping.findForward(success); } else { saveErrors(request, errors); if (newUserFrom.getPage() == 1) return mapping.findForward(user+newUserFrom.getPage()); if (newUserFrom.getPage() == 2) return mapping.findForward(user+newUserForm.getPage()); ... } struts-config snippet: ... action attribute=newUserFrom name=newUserFrom path=/newUser scope=session type=... validate=true forward name=success path=/index.html redirect=false contextRelative=false/ forward name=user1 path=newuser/index.jsp redirect=false contextRealtive=false/ ... /action newuser/index.jsp snippet: ... logic:messagesPresent html:messages id=error bean:write name=error/ /html:messages /logic:messagesPresent html:form action=newUser html:hidden property=action/ html:hidden property=page value=1/ ... /html:form I don's see any problem, wheres my failure? Thx Robert Lehner [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ High-speed usersbe more efficient online with the new MSN Premium Internet Software. http://join.msn.com/?pgmarket=en-uspage=byoa/premST=1 - 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: Validation Multiple Pages forward-Failure
using DynaValidatorActionForm would be the best way, you can use attribue page and use one Action form for all your 7 pages. tell me if you need more info, I'll describe it in details - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it!
Re: WebGroups css
I upload all resources (CSS, GIFs, JPEGs, SWFs, etc.) with an action class to avoid all these maddening URL problems caused by the differing perspectives of the client and server. If you get away from the URL solution, and use the .do solution, then URLs are no longer an issue. If you look at the source code for the opening page at www.michaelmcgrady.com, you can see how this works. The code on that page for the CSS is: LINK href=RESOURCE.MICHAELMcGRADY?file_type=cssfile_name=css_welcome.css type=text/css rel=stylesheet This avoids all URL issues because that protocol is abandoned completely. If you are interested in how to do this, just let me know and I will send you the classes. It is pretty simple. At 12:14 AM 1/27/2004, Manuel Lenz wrote: Hi you, I do have a silly problem with style sheets-linking. I have a css-File in the folder /theme/formats.css. I access this file from a jsp-page of the folder /help/info.jsp with this link: LINK href=../theme/formats.css rel=stylesheet type=text/css This works, if I call the jsp-Page directly. There is another jsp-page in the folder called /help/infoTest.jsp. This page is called from struts-config with a forward. The page has exactly the same code for linking the css-File. But when the jsp-Page is called, the css-File is not found and the server is showing this message: Web group /theme/formats.css is not defined (Die Webgruppe /theme/formats.css wurde nicht definiert.) Does anybody have an idea how to solve this problem? Manuel - 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: Ann: East Coast Advanced MVC Seminar: 7 Speakers
19 people signed up so far. Cool. Price goes up tmrw. .V Vic Cekvenich wrote: At nyhotel.com on April 3rd, convenient by train from Boston, NJ, Philly and DC. 1 day early registration rate at baseBeans.com now! Price will go to $495 and up as the date approaches, and there are limited seats in the booked room. As advertised in upcoming Feb. issue of JDJ. (scroll down to see the JDJ Ad as it will appear) You can get advanced Struts sessions without going to JavaOne. Visit NYC in Spring. After registration, you will receive a CD of conference materials, before the conference. Speakers presenting live: Husted, Raible, Begin, Canter, Cekvenich, Lewis-Ship, Johnson Bring your questions! More information coming... but you can lock the rate now. .V ps: Q:What happened to baseBeans site? A.My HD crashed, it will take me a while to fix. pps: Q:Is there any more info on the seminar available now? A: Not yet. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Best Practices question
Jim, Throw custom exceptions in your business beans and then use the struts declarative exception handling feature so that your custom exception handler class(es) handle the exceptions by populating ActionMessages and logging the error if neccessary. Check out this article by Keld H. Hansen http://javaboutique.internet.com/tutorials/excep_struts/index-7.html -Richard -Original Message- From: Anderson, James H [IT] [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 5:31 AM To: Struts Users Mailing List Subject: Best Practices question What is considered the best way for a business bean to handle errors so that they eventually get to ActionErrors? And what about business logging? Thanks, jim - 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: Best Practices question
Thanks very much, the article is just what I was looking for. jim -Original Message- From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 12:22 PM To: 'Struts Users Mailing List' Subject: RE: Best Practices question Jim, Throw custom exceptions in your business beans and then use the struts declarative exception handling feature so that your custom exception handler class(es) handle the exceptions by populating ActionMessages and logging the error if neccessary. Check out this article by Keld H. Hansen http://javaboutique.internet.com/tutorials/excep_struts/index-7.html -Richard -Original Message- From: Anderson, James H [IT] [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 5:31 AM To: Struts Users Mailing List Subject: Best Practices question What is considered the best way for a business bean to handle errors so that they eventually get to ActionErrors? And what about business logging? Thanks, jim - 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: Validation Multiple Pages forward-Failure
Hallo I'm using *.do mapping in my web.xml so I must use input=/newUser ? This does not work! Ben Anderson wrote: You want to put validate=true for the action you are submitting to. That's also where you specify the input. The input is an application relative path beginning with a /, so if you're using /do/* mapping in your web.xml you'd want something like this action name=newUserFrom path=/nextPathInProcess validate=true input=/do/newUser however, I think it's generally best to just forward back to the jsp: input=/pages/newUser.jsp I could not user input=/newuser/newUser.jsp because there is no file like newUser.jsp . I have the files index.jsp, address.jsp, services.jsp, status.jsp where I distribute the objects (name, fist name, street, city etc) from my NewUserFrom. When I mistype anything i.E. in index.jsp it should redisplay the index.jsp with the errormsg otherwise it should display the next page (address.jsp) and so on. Like in my NewUserAktion snippt down. (Also shown in the struts-validation example of the struts-distribution but without JavaScript!!) If you would see the full NewUserAction mail me and i would send it to you via pm. thx Robert Lehner From: Robert Lehner [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Validation Multiple Pages forward-Failure Date: Tue, 27 Jan 2004 18:19:18 +0100 Hello I saw this in the dtd, but I don't knowe what I should enter as value of input. I tried newUser, newUser.do, newUserFrom nothing worked es expected. I would to get back the form where the validation find the failure, so the User could corret his failure an procced the applikation. BTW: I used the struts-validation exmaple as pattern. I changed in the pattern struts-config.xml at the action multiRegistration the validation to true and the applikation dosen't work any more. Why? Thx Robert Lehner Ben Anderson wrote: struts validation uses the input attribute of the action tag to send you back to where you came from if validation fails. Here's the excerpt from the dtd: input Module-relative path of the action or other resource to which control should be returned if a validation error is encountered. Valid only when name is specified. Required if name is specified and the input bean returns validation errors. Optional if name is specified and the input bean does not return validation errors you must specify this attribute if you want to use struts validation. -Ben From: Robert Lehner [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Validation Multiple Pages forward-Failure Date: Tue, 27 Jan 2004 14:01:16 +0100 Hello, I have a MultiPageFrom with 7 seperate JSP-Pages. I want to validate all these pages. When I run the application and whould test if the validation works well, I get the following error when I hit Submit. --- type Status report message No input attribute for mapping path /newUser description The server encountered an internal error (No input attribute for mapping path /newUser) that prevented it from fulfilling this request. --- When validate is false, it works correctly, without validation. No validation is not a solution. Some more information: NewUserAktion snippet: ... ActionErrors errors = newUserFrom.validate(mapping, request); if (errors != null errros.isEmpty()){ if (newUserFrom.getPage() == 1) return mapping.findForward(user2); ... if (newUserFrom.getPage() == 7) return mapping.findForward(success); } else { saveErrors(request, errors); if (newUserFrom.getPage() == 1) return mapping.findForward(user+newUserFrom.getPage()); if (newUserFrom.getPage() == 2) return mapping.findForward(user+newUserForm.getPage()); ... } struts-config snippet: ... action attribute=newUserFrom name=newUserFrom path=/newUser scope=session type=... validate=true forward name=success path=/index.html redirect=false contextRelative=false/ forward name=user1 path=newuser/index.jsp redirect=false contextRealtive=false/ ... /action newuser/index.jsp snippet: ... logic:messagesPresent html:messages id=error bean:write name=error/ /html:messages /logic:messagesPresent html:form action=newUser html:hidden property=action/ html:hidden property=page value=1/ ... /html:form I don's see any problem, wheres my failure? Thx Robert Lehner [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ High-speed usersbe more efficient online with the new MSN Premium Internet Software.
Action mappings
I t seems Struts lets you use action mappings that it figures out and forwards for you, but I have had no luck testing this. action-mappings action path=/setUpEmployeeForm type=net.strutstest.SetUpEmployeeAction name=employeeForm scope=request validate=false forward name=continue path=/steve/ /action action path=/steve type=net.strutstest.SteveAction name=employeeForm scope=request validate=false forward name=continue path=/employeeForm.jsp/ /action So basically SetUpEmployeeAction should be called when the user submits. Then SetUpEmployeeAction forward to SteveAction and then that forwards to employeeForm.jsp. It errors out trying to load the resource SteveAction, but I see nothing else I need to declare in any properties file or resource file. Struts should be able to do this from what I've read. - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it!
Re: Struts upload
Thanks Guys I will check this example Regards my Friends... Edgar Silva - Brazil From: hhlow [EMAIL PROTECTED] Reply-To: hhlow [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Struts upload Date: Tue, 27 Jan 2004 16:01:54 +0800 there is struts upload example in the struts download package u also can use the commons package. Clement - Original Message - From: Edgar Silva [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 7:52 AM Subject: Struts upload Hi Folks... Anybody can send to me any address of docs or articles, talking about Struts uploads. since now... TIA Edgar _ MSN Hotmail, o maior webmail do Brasil. http://www.hotmail.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] _ MSN Hotmail, o maior webmail do Brasil. http://www.hotmail.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
form validation question
I am having a curious problem with form validation. I submit a form, see in the logs that the form fails to validate, however, the webapp does not return to the input page (I get a blank page with no HTML in it), so I do not see the form with error messages as expected. If I put text in the field, the form does submit correctly and I see the JSP specified in the resulting action chain. The log files have no error messages indicating something is amiss. When validation fails, the subsequent action is definitely not running (I do not see the logging in the execute method). Does anyone have any ideas what could be happening here? Or how I can track down the problem? Below is the relevant info... === STRUTS CONFIG === action path=/OrderForm forward=/web/forms/orderForm.jsp / action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action action path=/OrderThanks parameter=/web/orderThanks.jsp type=org.apache.struts.actions.ForwardAction/ === orderForm.jsp === logic:messagesPresent html:messages id=err %=err%br/ /html:messages /logic:messagesPresent html:form action=SubmitOrder.do html:text property=firstName styleId=firstName size=20/ html:submit value=Press Me/ /html:form === VALIDATION CONFIG === form name=orderForm field property=firstName depends=required arg0 key=orderForm.firstName.label name=required / /field /form === LOG MESSAGES === [org.apache.struts.action.RequestProcessor][RequestProcessor] Validating input form properties [org.apache.struts.action.RequestProcessor][RequestProcessor] Validation failed, returning to '/OrderForm.do' Andy Kriger | Software Mechanic | Greater Than One, Inc. 28 West 27th Street | 7th Floor | New York, NY 10001 P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED]
Re: form validation question
Andy: What do you see in the source of the html page..? Maybe it is just a question of display not working right..? Geeta Andy Kriger wrote: I am having a curious problem with form validation. I submit a form, see in the logs that the form fails to validate, however, the webapp does not return to the input page (I get a blank page with no HTML in it), so I do not see the form with error messages as expected. If I put text in the field, the form does submit correctly and I see the JSP specified in the resulting action chain. The log files have no error messages indicating something is amiss. When validation fails, the subsequent action is definitely not running (I do not see the logging in the execute method). Does anyone have any ideas what could be happening here? Or how I can track down the problem? Below is the relevant info... === STRUTS CONFIG === action path=/OrderForm forward=/web/forms/orderForm.jsp / action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action action path=/OrderThanks parameter=/web/orderThanks.jsp type=org.apache.struts.actions.ForwardAction/ === orderForm.jsp === logic:messagesPresent html:messages id=err %=err%br/ /html:messages /logic:messagesPresent html:form action=SubmitOrder.do html:text property=firstName styleId=firstName size=20/ html:submit value=Press Me/ /html:form === VALIDATION CONFIG === form name=orderForm field property=firstName depends=required arg0 key=orderForm.firstName.label name=required / /field /form === LOG MESSAGES === [org.apache.struts.action.RequestProcessor][RequestProcessor] Validating input form properties [org.apache.struts.action.RequestProcessor][RequestProcessor] Validation failed, returning to '/OrderForm.do' Andy Kriger | Software Mechanic | Greater Than One, Inc. 28 West 27th Street | 7th Floor | New York, NY 10001 P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action mappings
Of course. [EMAIL PROTECTED] 1/27/2004 12:45:01 PM I t seems Struts lets you use action mappings that it figures out and forwards for you, but I have had no luck testing this. action-mappings action path=/setUpEmployeeForm type=net.strutstest.SetUpEmployeeAction name=employeeForm scope=request validate=false forward name=continue path=/steve/ /action action path=/steve type=net.strutstest.SteveAction name=employeeForm scope=request validate=false forward name=continue path=/employeeForm.jsp/ /action So basically SetUpEmployeeAction should be called when the user submits. Then SetUpEmployeeAction forward to SteveAction and then that forwards to employeeForm.jsp. It errors out trying to load the resource SteveAction, but I see nothing else I need to declare in any properties file or resource file. Struts should be able to do this from what I've read. - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
log4j integration
Hi! I have integrated log4j with struts. I need to know how to ensure that the changes done to log4j.properties file is taken into account at run time. TIA, Richie To achieve all that is possible, one must attempt the impossible - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation Multiple Pages forward-Failure
hi enter input=/myFormular.jsp so validate goes back to formular there you can display action-messages (or even errors if you use) cheers, matthias -Original Message- From: Robert Lehner [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 7:13 PM To: Struts Users Mailing List Subject: Re: Validation Multiple Pages forward-Failure Hallo I'm using *.do mapping in my web.xml so I must use input=/newUser ? This does not work! Ben Anderson wrote: You want to put validate=true for the action you are submitting to. That's also where you specify the input. The input is an application relative path beginning with a /, so if you're using /do/* mapping in your web.xml you'd want something like this action name=newUserFrom path=/nextPathInProcess validate=true input=/do/newUser however, I think it's generally best to just forward back to the jsp: input=/pages/newUser.jsp I could not user input=/newuser/newUser.jsp because there is no file like newUser.jsp . I have the files index.jsp, address.jsp, services.jsp, status.jsp where I distribute the objects (name, fist name, street, city etc) from my NewUserFrom. When I mistype anything i.E. in index.jsp it should redisplay the index.jsp with the errormsg otherwise it should display the next page (address.jsp) and so on. Like in my NewUserAktion snippt down. (Also shown in the struts-validation example of the struts-distribution but without JavaScript!!) If you would see the full NewUserAction mail me and i would send it to you via pm. thx Robert Lehner From: Robert Lehner [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Validation Multiple Pages forward-Failure Date: Tue, 27 Jan 2004 18:19:18 +0100 Hello I saw this in the dtd, but I don't knowe what I should enter as value of input. I tried newUser, newUser.do, newUserFrom nothing worked es expected. I would to get back the form where the validation find the failure, so the User could corret his failure an procced the applikation. BTW: I used the struts-validation exmaple as pattern. I changed in the pattern struts-config.xml at the action multiRegistration the validation to true and the applikation dosen't work any more. Why? Thx Robert Lehner Ben Anderson wrote: struts validation uses the input attribute of the action tag to send you back to where you came from if validation fails. Here's the excerpt from the dtd: input Module-relative path of the action or other resource to which control should be returned if a validation error is encountered. Valid only when name is specified. Required if name is specified and the input bean returns validation errors. Optional if name is specified and the input bean does not return validation errors you must specify this attribute if you want to use struts validation. -Ben From: Robert Lehner [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Validation Multiple Pages forward-Failure Date: Tue, 27 Jan 2004 14:01:16 +0100 Hello, I have a MultiPageFrom with 7 seperate JSP-Pages. I want to validate all these pages. When I run the application and whould test if the validation works well, I get the following error when I hit Submit. --- type Status report message No input attribute for mapping path /newUser description The server encountered an internal error (No input attribute for mapping path /newUser) that prevented it from fulfilling this request. --- When validate is false, it works correctly, without validation. No validation is not a solution. Some more information: NewUserAktion snippet: ... ActionErrors errors = newUserFrom.validate(mapping, request); if (errors != null errros.isEmpty()){ if (newUserFrom.getPage() == 1) return mapping.findForward(user2); ... if (newUserFrom.getPage() == 7) return mapping.findForward(success); } else { saveErrors(request, errors); if (newUserFrom.getPage() == 1) return mapping.findForward(user+newUserFrom.getPage()); if (newUserFrom.getPage() == 2) return mapping.findForward(user+newUserForm.getPage()); ... } struts-config snippet: ... action attribute=newUserFrom name=newUserFrom path=/newUser scope=session type=... validate=true forward name=success path=/index.html redirect=false contextRelative=false/ forward name=user1 path=newuser/index.jsp redirect=false contextRealtive=false/ ... /action newuser/index.jsp snippet: ... logic:messagesPresent html:messages id=error bean:write name=error/ /html:messages /logic:messagesPresent html:form action=newUser html:hidden
Dynamic form, initial value for String[] property?
I'm trying to use a String[] property and preselect the none option which corresponds to an empty String. If it were a simple string property, I could do: form-property name=account type=java.lang.String initial= / What do I put in the 'initial' attribute for this one? form-property name=accounts type=java.lang.String[] initial=??? / Essentially, I need this: new String[] { }; -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
populating session object
Hello! Currently, in my design, I am using a DO class and a DOService class for my business logic. In my case, I make a db query to get a list of all employees. But, at the end, the result has to be set in a session or in a request object. Given a case where we have lots of users making a get, I believe the memory requirement will go up and will need a very high RAM. Is there any other way of handling this or I am missing something? Richie To achieve all that is possible, one must attempt the impossible - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Action mappings
What is the error when it errors out? -Original Message- From: struts fox [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 12:45 PM To: [EMAIL PROTECTED] Subject: Action mappings I t seems Struts lets you use action mappings that it figures out and forwards for you, but I have had no luck testing this. action-mappings action path=/setUpEmployeeForm type=net.strutstest.SetUpEmployeeAction name=employeeForm scope=request validate=false forward name=continue path=/steve/ /action action path=/steve type=net.strutstest.SteveAction name=employeeForm scope=request validate=false forward name=continue path=/employeeForm.jsp/ /action So basically SetUpEmployeeAction should be called when the user submits. Then SetUpEmployeeAction forward to SteveAction and then that forwards to employeeForm.jsp. It errors out trying to load the resource SteveAction, but I see nothing else I need to declare in any properties file or resource file. Struts should be able to do this from what I've read. - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
log4j with struts
Hi! I am afraid I am sending this mail for the second time. Last time, I had pasted my code for some queries and I am yet to see the post. So here goes. I have integred log4j with struts1.1. I need to know how to ensure that if changes are done to log4j.properties file, they are taken into affect immediately? Richie To achieve all that is possible, one must attempt the impossible - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: log4j integration
This is OT. The word struts in a message is not the only thing it needs to be struts related... Try PropertyConfigurator.configureAndWatch, I think that is what you are searching for... You cand find a simple example at http://www.jguru.com/forums/view.jsp?EID=1130416 Un saludo, chicos. Guido. shankarr wrote: Hi! I have integrated log4j with struts. I need to know how to ensure that the changes done to log4j.properties file is taken into account at run time. TIA, Richie To achieve all that is possible, one must attempt the impossible - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation Multiple Pages forward-Failure
You need to have a value for the input attribute on your action mapping definition for your newUser action. When enabling validation, what struts does is that if validation fails, it does not give control to your action class but directly forwards to the target defined by the input attribute. So you would have something like this in your struts config: action attribute=newUserFrom name=newUserFrom path=/newUser scope=session type=... *** Add this input=the_form_i_come_from.jsp Eric. -Original Message- From: Robert Lehner [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 4:35 PM To: Struts Users Mailing List Subject: Validation Multiple Pages forward-Failure Hello, I have a MultiPageFrom with 7 seperate JSP-Pages. I want to validate all these pages. When I run the application and whould test if the validation works well, I get the following error when I hit Submit. --- type Status report message No input attribute for mapping path /newUser description The server encountered an internal error (No input attribute for mapping path /newUser) that prevented it from fulfilling this request. --- When validate is false, it works correctly, without validation. No validation is not a solution. Some more information: NewUserAktion snippet: ... ActionErrors errors = newUserFrom.validate(mapping, request); if (errors != null errros.isEmpty()){ if (newUserFrom.getPage() == 1) return mapping.findForward(user2); ... if (newUserFrom.getPage() == 7) return mapping.findForward(success); } else { saveErrors(request, errors); if (newUserFrom.getPage() == 1) return mapping.findForward(user+newUserFrom.getPage()); if (newUserFrom.getPage() == 2) return mapping.findForward(user+newUserForm.getPage()); ... } struts-config snippet: ... action attribute=newUserFrom name=newUserFrom path=/newUser scope=session type=... validate=true forward name=success path=/index.html redirect=false contextRelative=false/ forward name=user1 path=newuser/index.jsp redirect=false contextRealtive=false/ ... /action newuser/index.jsp snippet: ... logic:messagesPresent html:messages id=error bean:write name=error/ /html:messages /logic:messagesPresent html:form action=newUser html:hidden property=action/ html:hidden property=page value=1/ ... /html:form I don's see any problem, wheres my failure? Thx Robert Lehner [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: populating session object
Maybe you can use the application scope: foo.Employees employees = (foo.Counter)getServletContext().getAttribute(employees); if (employees == null) { employees = new foo.Employees(); getServletContext().setAttribute(employees, employees); } and then jsp:useBean class=foo.Employees *scope=application* / Be careful, because I am almost sure that objects placed in application scope will be used by more than one thread so you must design them accordingly. Regards! Guido García PD. BTW, is there any _free_ memory profiler or something similar to JProbe or OptimizeIt? shankarr wrote: Hello! Currently, in my design, I am using a DO class and a DOService class for my business logic. In my case, I make a db query to get a list of all employees. But, at the end, the result has to be set in a session or in a request object. Given a case where we have lots of users making a get, I believe the memory requirement will go up and will need a very high RAM. Is there any other way of handling this or I am missing something? Richie To achieve all that is possible, one must attempt the impossible - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: form validation question
I see an empty page - no HTML, no nothing. It's as if the handoff to the input path never happens, even though the logging informs me that validation failed and the input path is being returned to. When you say 'a question of display not working right', what do you have in mind? -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 3:05 PM To: Struts Users Mailing List Subject: Re: form validation question Andy: What do you see in the source of the html page..? Maybe it is just a question of display not working right..? Geeta Andy Kriger wrote: I am having a curious problem with form validation. I submit a form, see in the logs that the form fails to validate, however, the webapp does not return to the input page (I get a blank page with no HTML in it), so I do not see the form with error messages as expected. If I put text in the field, the form does submit correctly and I see the JSP specified in the resulting action chain. The log files have no error messages indicating something is amiss. When validation fails, the subsequent action is definitely not running (I do not see the logging in the execute method). Does anyone have any ideas what could be happening here? Or how I can track down the problem? Below is the relevant info... === STRUTS CONFIG === action path=/OrderForm forward=/web/forms/orderForm.jsp / action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action action path=/OrderThanks parameter=/web/orderThanks.jsp type=org.apache.struts.actions.ForwardAction/ === orderForm.jsp === logic:messagesPresent html:messages id=err %=err%br/ /html:messages /logic:messagesPresent html:form action=SubmitOrder.do html:text property=firstName styleId=firstName size=20/ html:submit value=Press Me/ /html:form === VALIDATION CONFIG === form name=orderForm field property=firstName depends=required arg0 key=orderForm.firstName.label name=required / /field /form === LOG MESSAGES === [org.apache.struts.action.RequestProcessor][RequestProcessor] Validating input form properties [org.apache.struts.action.RequestProcessor][RequestProcessor] Validation failed, returning to '/OrderForm.do' Andy Kriger | Software Mechanic | Greater Than One, Inc. 28 West 27th Street | 7th Floor | New York, NY 10001 P: 212.252.7197 | F: 212.252.7364 | E: [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: Action mappings
Do you have web.xml configured with /do URLS going to struts. If so, your entry should be, Notice that the path is the complete path with the prefix. action path=/setUpEmployeeForm type=net.strutstest.SetUpEmployeeAction name=employeeForm scope=request validate=false forward name=continue path=/do/steve/ /action Hope this helps -jayash -Original Message- From: struts fox [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 11:45 AM To: [EMAIL PROTECTED] Subject: Action mappings I t seems Struts lets you use action mappings that it figures out and forwards for you, but I have had no luck testing this. action-mappings action path=/setUpEmployeeForm type=net.strutstest.SetUpEmployeeAction name=employeeForm scope=request validate=false forward name=continue path=/steve/ /action action path=/steve type=net.strutstest.SteveAction name=employeeForm scope=request validate=false forward name=continue path=/employeeForm.jsp/ /action So basically SetUpEmployeeAction should be called when the user submits. Then SetUpEmployeeAction forward to SteveAction and then that forwards to employeeForm.jsp. It errors out trying to load the resource SteveAction, but I see nothing else I need to declare in any properties file or resource file. Struts should be able to do this from what I've read. - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: log4j integration
Ritchie: Just make sure the log4j.properties is in your class path.. (like maybe right in your classes directory). that should do it.. Regards, Geeta shankarr wrote: Hi! I have integrated log4j with struts. I need to know how to ensure that the changes done to log4j.properties file is taken into account at run time. TIA, Richie To achieve all that is possible, one must attempt the impossible - 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: form validation question
Your orderForm does extend ValidatorForm instead of ActionForm right? The struts validator plug-in relies on your forms extending ValidatorForm in order to do server-side validations. Out of curiosity, you may want to see if client-side validation works first. html:form action=SubmitOrder.do onsubmit=return validateOrderForm(this) ... /html:form validator:javascript formName=orderForm/ When the submit button is pressed, if the required field is empty, you should get a message window indicating the field is required. Brian Barnett -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 1:16 PM To: 'Struts Users Mailing List' Subject: RE: form validation question I see an empty page - no HTML, no nothing. It's as if the handoff to the input path never happens, even though the logging informs me that validation failed and the input path is being returned to. When you say 'a question of display not working right', what do you have in mind? -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 3:05 PM To: Struts Users Mailing List Subject: Re: form validation question Andy: What do you see in the source of the html page..? Maybe it is just a question of display not working right..? Geeta Andy Kriger wrote: I am having a curious problem with form validation. I submit a form, see in the logs that the form fails to validate, however, the webapp does not return to the input page (I get a blank page with no HTML in it), so I do not see the form with error messages as expected. If I put text in the field, the form does submit correctly and I see the JSP specified in the resulting action chain. The log files have no error messages indicating something is amiss. When validation fails, the subsequent action is definitely not running (I do not see the logging in the execute method). Does anyone have any ideas what could be happening here? Or how I can track down the problem? Below is the relevant info... === STRUTS CONFIG === action path=/OrderForm forward=/web/forms/orderForm.jsp / action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action action path=/OrderThanks parameter=/web/orderThanks.jsp type=org.apache.struts.actions.ForwardAction/ === orderForm.jsp === logic:messagesPresent html:messages id=err %=err%br/ /html:messages /logic:messagesPresent html:form action=SubmitOrder.do html:text property=firstName styleId=firstName size=20/ html:submit value=Press Me/ /html:form === VALIDATION CONFIG === form name=orderForm field property=firstName depends=required arg0 key=orderForm.firstName.label name=required / /field /form === LOG MESSAGES === [org.apache.struts.action.RequestProcessor][RequestProcessor] Validating input form properties [org.apache.struts.action.RequestProcessor][RequestProcessor] Validation failed, returning to '/OrderForm.do' Andy Kriger | Software Mechanic | Greater Than One, Inc. 28 West 27th Street | 7th Floor | New York, NY 10001 P: 212.252.7197 | F: 212.252.7364 | E: [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: form validation question
Andy: Any reason why you have the unusual input param..? action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action I woud have thought you'd use this instead: action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/web/forms/orderForm.jsp scope=request forward name=success path=/OrderThanks.do/ /action Regards, Geeta Andy Kriger wrote: I am having a curious problem with form validation. I submit a form, see in the logs that the form fails to validate, however, the webapp does not return to the input page (I get a blank page with no HTML in it), so I do not see the form with error messages as expected. If I put text in the field, the form does submit correctly and I see the JSP specified in the resulting action chain. The log files have no error messages indicating something is amiss. When validation fails, the subsequent action is definitely not running (I do not see the logging in the execute method). Does anyone have any ideas what could be happening here? Or how I can track down the problem? Below is the relevant info... === STRUTS CONFIG === action path=/OrderForm forward=/web/forms/orderForm.jsp / action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action action path=/OrderThanks parameter=/web/orderThanks.jsp type=org.apache.struts.actions.ForwardAction/ === orderForm.jsp === logic:messagesPresent html:messages id=err %=err%br/ /html:messages /logic:messagesPresent html:form action=SubmitOrder.do html:text property=firstName styleId=firstName size=20/ html:submit value=Press Me/ /html:form === VALIDATION CONFIG === form name=orderForm field property=firstName depends=required arg0 key=orderForm.firstName.label name=required / /field /form === LOG MESSAGES === [org.apache.struts.action.RequestProcessor][RequestProcessor] Validating input form properties [org.apache.struts.action.RequestProcessor][RequestProcessor] Validation failed, returning to '/OrderForm.do' Andy Kriger | Software Mechanic | Greater Than One, Inc. 28 West 27th Street | 7th Floor | New York, NY 10001 P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: form validation question
OrderForm.do = /web/forms/orderForm.jsp That shouldn't make a difference. I like to refer to actions rather than JSPs to minimize the number of things I have to change if a JSP changes to a different JSP or to another action. -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 3:27 PM To: Struts Users Mailing List Subject: Re: form validation question Andy: Any reason why you have the unusual input param..? action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action I woud have thought you'd use this instead: action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/web/forms/orderForm.jsp scope=request forward name=success path=/OrderThanks.do/ /action Regards, Geeta Andy Kriger wrote: I am having a curious problem with form validation. I submit a form, see in the logs that the form fails to validate, however, the webapp does not return to the input page (I get a blank page with no HTML in it), so I do not see the form with error messages as expected. If I put text in the field, the form does submit correctly and I see the JSP specified in the resulting action chain. The log files have no error messages indicating something is amiss. When validation fails, the subsequent action is definitely not running (I do not see the logging in the execute method). Does anyone have any ideas what could be happening here? Or how I can track down the problem? Below is the relevant info... === STRUTS CONFIG === action path=/OrderForm forward=/web/forms/orderForm.jsp / action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action action path=/OrderThanks parameter=/web/orderThanks.jsp type=org.apache.struts.actions.ForwardAction/ === orderForm.jsp === logic:messagesPresent html:messages id=err %=err%br/ /html:messages /logic:messagesPresent html:form action=SubmitOrder.do html:text property=firstName styleId=firstName size=20/ html:submit value=Press Me/ /html:form === VALIDATION CONFIG === form name=orderForm field property=firstName depends=required arg0 key=orderForm.firstName.label name=required / /field /form === LOG MESSAGES === [org.apache.struts.action.RequestProcessor][RequestProcessor] Validating input form properties [org.apache.struts.action.RequestProcessor][RequestProcessor] Validation failed, returning to '/OrderForm.do' Andy Kriger | Software Mechanic | Greater Than One, Inc. 28 West 27th Street | 7th Floor | New York, NY 10001 P: 212.252.7197 | F: 212.252.7364 | E: [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: Validation Multiple Pages forward-Failure
Hello Matthias Wessendorf wrote: hi enter input=/myFormular.jsp so validate goes back to formular there you can display action-messages (or even errors if you use) Yes this would work if I hade one JSP-Page, but I have (now) one Form(getter and setter methods), one ActionForm and seven JSP-Pages wich are would be filled one after the other (and validated, without validation it works for now). At the end I would show all the values to the user and when submitting the entries the actionFrom should call a bussnessdelegate and store the vaules pesistent (via JDO) in a DBMS. CU Robert cheers, matthias -Original Message- From: Robert Lehner [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 7:13 PM To: Struts Users Mailing List Subject: Re: Validation Multiple Pages forward-Failure Hallo I'm using *.do mapping in my web.xml so I must use input=/newUser ? This does not work! Ben Anderson wrote: You want to put validate=true for the action you are submitting to. That's also where you specify the input. The input is an application relative path beginning with a /, so if you're using /do/* mapping in your web.xml you'd want something like this action name=newUserFrom path=/nextPathInProcess validate=true input=/do/newUser however, I think it's generally best to just forward back to the jsp: input=/pages/newUser.jsp I could not user input=/newuser/newUser.jsp because there is no file like newUser.jsp . I have the files index.jsp, address.jsp, services.jsp, status.jsp where I distribute the objects (name, fist name, street, city etc) from my NewUserFrom. When I mistype anything i.E. in index.jsp it should redisplay the index.jsp with the errormsg otherwise it should display the next page (address.jsp) and so on. Like in my NewUserAktion snippt down. (Also shown in the struts-validation example of the struts-distribution but without JavaScript!!) If you would see the full NewUserAction mail me and i would send it to you via pm. thx Robert Lehner From: Robert Lehner [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Validation Multiple Pages forward-Failure Date: Tue, 27 Jan 2004 18:19:18 +0100 Hello I saw this in the dtd, but I don't knowe what I should enter as value of input. I tried newUser, newUser.do, newUserFrom nothing worked es expected. I would to get back the form where the validation find the failure, so the User could corret his failure an procced the applikation. BTW: I used the struts-validation exmaple as pattern. I changed in the pattern struts-config.xml at the action multiRegistration the validation to true and the applikation dosen't work any more. Why? Thx Robert Lehner Ben Anderson wrote: struts validation uses the input attribute of the action tag to send you back to where you came from if validation fails. Here's the excerpt from the dtd: input Module-relative path of the action or other resource to which control should be returned if a validation error is encountered. Valid only when name is specified. Required if name is specified and the input bean returns validation errors. Optional if name is specified and the input bean does not return validation errors you must specify this attribute if you want to use struts validation. -Ben From: Robert Lehner [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Validation Multiple Pages forward-Failure Date: Tue, 27 Jan 2004 14:01:16 +0100 Hello, I have a MultiPageFrom with 7 seperate JSP-Pages. I want to validate all these pages. When I run the application and whould test if the validation works well, I get the following error when I hit Submit. --- type Status report message No input attribute for mapping path /newUser description The server encountered an internal error (No input attribute for mapping path /newUser) that prevented it from fulfilling this request. --- When validate is false, it works correctly, without validation. No validation is not a solution. Some more information: NewUserAktion snippet: ... ActionErrors errors = newUserFrom.validate(mapping, request); if (errors != null errros.isEmpty()){ if (newUserFrom.getPage() == 1) return mapping.findForward(user2); ... if (newUserFrom.getPage() == 7) return mapping.findForward(success); } else { saveErrors(request, errors); if (newUserFrom.getPage() == 1) return mapping.findForward(user+newUserFrom.getPage()); if (newUserFrom.getPage() == 2) return mapping.findForward(user+newUserForm.getPage()); ... } struts-config snippet: ... action attribute=newUserFrom name=newUserFrom path=/newUser scope=session type=... validate=true forward name=success path=/index.html redirect=false
Problems Redirecting To Input Page After Vaildation Fails
Hello can anybody help me with this problem I'm having please? I am using the same action to perform two functions action path=/clientaction type=ie.sentenial.application.actions.ClientAction name=clientForm scope=request input=/pages/addClient.jsp attribute=clientForm /action This is called as follows from 2 different forms: html:form action=/clientaction?action=update focus=clientName onsubmit=return validateClientForm(this) and html:form action=/clientaction?action=add focus=clientName onsubmit=return validateClientForm(this) The problem is that because I have input=/pages/addClient.jsp ...that when a validation fails while doing an update it is directed back to the addClient.jsp rather than the updateClient.jsp As far as I know the input field will not take dynamic values. I am not sure how to resolve this problem. I need to be directed back to the correct page when validations fail Thanks Ciaran
RE: form validation question
orderForm was extending DynaValidatorForm. I changed this to DynaValidatorActionForm - now the form validates (though it shouldn't - there's a required field missing). Looks like I'm one step closer to a solution. Thank you for the idea. -Original Message- From: Barnett, Brian W. [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 5:10 PM To: 'Struts Users Mailing List' Subject: RE: form validation question Your orderForm does extend ValidatorForm instead of ActionForm right? The struts validator plug-in relies on your forms extending ValidatorForm in order to do server-side validations. Out of curiosity, you may want to see if client-side validation works first. html:form action=SubmitOrder.do onsubmit=return validateOrderForm(this) ... /html:form validator:javascript formName=orderForm/ When the submit button is pressed, if the required field is empty, you should get a message window indicating the field is required. Brian Barnett -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 1:16 PM To: 'Struts Users Mailing List' Subject: RE: form validation question I see an empty page - no HTML, no nothing. It's as if the handoff to the input path never happens, even though the logging informs me that validation failed and the input path is being returned to. When you say 'a question of display not working right', what do you have in mind? -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 3:05 PM To: Struts Users Mailing List Subject: Re: form validation question Andy: What do you see in the source of the html page..? Maybe it is just a question of display not working right..? Geeta Andy Kriger wrote: I am having a curious problem with form validation. I submit a form, see in the logs that the form fails to validate, however, the webapp does not return to the input page (I get a blank page with no HTML in it), so I do not see the form with error messages as expected. If I put text in the field, the form does submit correctly and I see the JSP specified in the resulting action chain. The log files have no error messages indicating something is amiss. When validation fails, the subsequent action is definitely not running (I do not see the logging in the execute method). Does anyone have any ideas what could be happening here? Or how I can track down the problem? Below is the relevant info... === STRUTS CONFIG === action path=/OrderForm forward=/web/forms/orderForm.jsp / action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action action path=/OrderThanks parameter=/web/orderThanks.jsp type=org.apache.struts.actions.ForwardAction/ === orderForm.jsp === logic:messagesPresent html:messages id=err %=err%br/ /html:messages /logic:messagesPresent html:form action=SubmitOrder.do html:text property=firstName styleId=firstName size=20/ html:submit value=Press Me/ /html:form === VALIDATION CONFIG === form name=orderForm field property=firstName depends=required arg0 key=orderForm.firstName.label name=required / /field /form === LOG MESSAGES === [org.apache.struts.action.RequestProcessor][RequestProcessor] Validating input form properties [org.apache.struts.action.RequestProcessor][RequestProcessor] Validation failed, returning to '/OrderForm.do' Andy Kriger | Software Mechanic | Greater Than One, Inc. 28 West 27th Street | 7th Floor | New York, NY 10001 P: 212.252.7197 | F: 212.252.7364 | E: [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: Torque and Struts problem
BTW, if you can't use 1.4.2, a couple of workarounds to try: Introspector.setBeanInfoSearchPath(new String[] {}); or provide an org.ttemplating.internal.dataobjects.ComponentBeanInfo class. Quoting Kris Schneider [EMAIL PROTECTED]: This appears to be fixed in Sun's 1.4.2. A quick test failed with 1.4.1_06-b01 but passed with 1.4.2_03-b02. Quoting P. Daniell [EMAIL PROTECTED]: The problem is neither with Struts nor Torque but rather with the reflection API, which exhibits strange behavior when asked to deal with classes named Component. Strangely enough, I found a thread on the struts-user thread http://www.mail-archive.com/[EMAIL PROTECTED]/msg60817.html dealing with the same problem. Everything behaves properly when the class is renamed Komponent. PD - Original Message - From: Kris Schneider [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, January 26, 2004 3:14 PM Subject: Re: Torque and Struts problem My email's acting flaky, sorry if this gets posted twice: What happens with this instead of JSTL: jsp:useBean id=comptest scope=request type=org.ttemplating.internal.dataobjects.Component/ jsp:getProperty name=comptest property=name/ Paul Daniell wrote: From: Kris Schneider [EMAIL PROTECTED] I suppose this could be a classloader issue. Are all your Struts, Torque, and JSTL JAR files colocated? Yes. I am using Struts 1.1 rc1, Torque 3.0.2, and JSTL 1.0. Quoting Paul Daniell [EMAIL PROTECTED]: I've encountered a strange problem with Struts when used with Torque. I retrieve an object using the following: ArrayList list = (ArrayList)ComponentPeer.doSelect(new Criteria()); request.setAttribute(components, list); Component c = (Component)list.get(0); request.setAttribute(comptest, c); System.out.println(c.getName()); In the logs this will appropriately print the name of the object c. However, when I invoke the following JSP ... htmlbody c:out value=${comptest.name}/ /body/html I get the following Exception: HTTP ERROR: 500 An error occurred while evaluating custom action attribute value with value ${comptest.name}: An error occurred while getting property name from an instance of class org.ttemplating.internal.dataobjects.Component (java.lang.IllegalArgumentException: object is not an instance of declaring class) Any advice appreciated. Paul -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Action mappings
Are you using something like .do for your servlet mapping in the web.xml to map requests to the ActionServlet. The forward continue you have defined for you action /setUpEmployeeForm needs to have the servlet mapping extension, so it should look something like: forward name=continue path=/steve.do/ Cheers Pete -Original Message- From: struts fox [mailto:[EMAIL PROTECTED] Sent: Wednesday, 28 January 2004 8:45 a.m. To: [EMAIL PROTECTED] Subject: Action mappings I t seems Struts lets you use action mappings that it figures out and forwards for you, but I have had no luck testing this. action-mappings action path=/setUpEmployeeForm type=net.strutstest.SetUpEmployeeAction name=employeeForm scope=request validate=false forward name=continue path=/steve/ /action action path=/steve type=net.strutstest.SteveAction name=employeeForm scope=request validate=false forward name=continue path=/employeeForm.jsp/ /action So basically SetUpEmployeeAction should be called when the user submits. Then SetUpEmployeeAction forward to SteveAction and then that forwards to employeeForm.jsp. It errors out trying to load the resource SteveAction, but I see nothing else I need to declare in any properties file or resource file. Struts should be able to do this from what I've read. - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Enter Key vs. Submit Button
I have a .jsp page which submits through a post using SUBMIT button. If I type in a value for my one field and hit the submit button, all is well. If I type in a value and hit enter, I get an NullPointerException in my ActionForm as I am checking for which button is clicked using the following code: validate(---){ String buttonAction = request.getParameter(GSOPConstants.BUTTON_ACTION); System.out.println(-buttonAction===+buttonAction); } When I click SUBMIT button it prints properly where as if I click enter it prints NULL. I am sure there might be some wrok around. Any help greatly appreciated. Thanks, Srini - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems Redirecting To Input Page After Vaildation Fails
Personally, I would try to use the same page for add, update and delete, which would solve this problem. If this is not an option for you, you may have to deal with it in ClientAction. Remove the input attribute from your action mapping, add validate=false, and add a couple of forward elements. action path=/clientaction type=ie.sentenial.application.actions.ClientAction name=clientForm scope=request validate=false attribute=clientForm forward name=AddValidationError path=/pages/addClient.jsp/ forward name=UpdateValidationError path=/pages/updateClient.jsp/ /action Then inside ClientAction, programmatically call the validate() method, since the framework won't be calling it for us (validate=false). If validation fails, return the appropriate ActionForward, based on whether you are adding or updating. Brian Barnett -Original Message- From: Ciaran Hanley [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 11:57 AM To: Struts User Mailing List Subject: Problems Redirecting To Input Page After Vaildation Fails Hello can anybody help me with this problem I'm having please? I am using the same action to perform two functions action path=/clientaction type=ie.sentenial.application.actions.ClientAction name=clientForm scope=request input=/pages/addClient.jsp attribute=clientForm /action This is called as follows from 2 different forms: html:form action=/clientaction?action=update focus=clientName onsubmit=return validateClientForm(this) and html:form action=/clientaction?action=add focus=clientName onsubmit=return validateClientForm(this) The problem is that because I have input=/pages/addClient.jsp ...that when a validation fails while doing an update it is directed back to the addClient.jsp rather than the updateClient.jsp As far as I know the input field will not take dynamic values. I am not sure how to resolve this problem. I need to be directed back to the correct page when validations fail Thanks Ciaran - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re-deploying in JBoss3.2.3
I generally explode the ear and war files creating a directory structure in the 'deploy' directory. I can then added and amend JSP's at will within the directory structure. If I have a new class or changed any of the xml's (struts-config, tiles-config) then I simply touch the application.xml and Jboss goes ahead and runs through a re-deployment. Hope this helps. -- Marc -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: 26 January 2004 19:32 To: [EMAIL PROTECTED] Subject: Re-deploying in JBoss3.2.3 Importance: High Hi, Can anybody suggest me Is there anyway I can avoid re-deploy the ear file contains war again and again whenever we make changes to JSP's in JBoss 3.2.3 bundle with Tomcat 4.1.29..? earlier we were running separate container(JBoss and Tomcat as different container) and were able to re-deploy the war file without affecting the ear. Thank you in advance. -Ramadoss - 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: Action mappings
That fixed it!! Thanks. I was getting the application resource not found, which now obviously makes sense. Loving struts! Gopalakrishnan, Jayesh [EMAIL PROTECTED] wrote:Do you have web.xml configured with /do URLS going to struts. If so, your entry should be, Notice that the path is the complete path with the prefix. type=net.strutstest.SetUpEmployeeAction name=employeeForm scope=request validate=false Hope this helps -jayash -Original Message- From: struts fox [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 11:45 AM To: [EMAIL PROTECTED] Subject: Action mappings I t seems Struts lets you use action mappings that it figures out and forwards for you, but I have had no luck testing this. type=net.strutstest.SetUpEmployeeAction name=employeeForm scope=request validate=false type=net.strutstest.SteveAction name=employeeForm scope=request validate=false name=continue path=/employeeForm.jsp/ So basically SetUpEmployeeAction should be called when the user submits. Then SetUpEmployeeAction forward to SteveAction and then that forwards to employeeForm.jsp. It errors out trying to load the resource SteveAction, but I see nothing else I need to declare in any properties file or resource file. Struts should be able to do this from what I've read. - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it!
RE: Problems Redirecting To Input Page After Vaildation Fails
Ciaran, When all else fails, cut and paste. :-) Seriously, I don't know of a way to make the input value dynamic. I wish it could be done like tile definitions with one action mapping extending another, but, I know that is not supported. So, the simplest solution is to have two separate action mappings for the one action class that supports both adds and updates like so: action path=/clientaction/add type=ie.sentenial.application.actions.ClientAction name=clientForm scope=request input=/pages/addClient.jsp attribute=clientForm /action action path=/clientaction/update type=ie.sentenial.application.actions.ClientAction name=clientForm scope=request input=/pages/updateClient.jsp attribute=clientForm /action You still get code reuse of your action class, but, you have to duplicate the action mapping specification. If you want to avoid duplicating the action mapping, the other way to go is to have a single JSP that supports both adds and updates with conditional logic in the JSP based on a mode parameter which indicates whether it is being used for an add or an update. - Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts/ P.S. You don't need to specify both name and attribute values in your action mappings unless you want to store the form under a different name at request/session scope than the form configuration name. What you have done doesn't hurt anything, it is just not necessary to specify an attribute value unless the value specified for it is different than the name value. -Original Message- From: Ciaran Hanley [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 10:57 AM To: Struts User Mailing List Subject: Problems Redirecting To Input Page After Vaildation Fails Hello can anybody help me with this problem I'm having please? I am using the same action to perform two functions action path=/clientaction type=ie.sentenial.application.actions.ClientAction name=clientForm scope=request input=/pages/addClient.jsp attribute=clientForm /action This is called as follows from 2 different forms: html:form action=/clientaction?action=update focus=clientName onsubmit=return validateClientForm(this) and html:form action=/clientaction?action=add focus=clientName onsubmit=return validateClientForm(this) The problem is that because I have input=/pages/addClient.jsp ...that when a validation fails while doing an update it is directed back to the addClient.jsp rather than the updateClient.jsp As far as I know the input field will not take dynamic values. I am not sure how to resolve this problem. I need to be directed back to the correct page when validations fail Thanks Ciaran - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form validation question
Ok, maybe, I'd have to check into struts code to really be certain(input surely has some significance is what i'm thinking..) So just for the heck of it though, what happens if you do say /web/forms/orderForm.jsp instead? Andy Kriger wrote: OrderForm.do = /web/forms/orderForm.jsp That shouldn't make a difference. I like to refer to actions rather than JSPs to minimize the number of things I have to change if a JSP changes to a different JSP or to another action. -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 3:27 PM To: Struts Users Mailing List Subject: Re: form validation question Andy: Any reason why you have the unusual input param..? action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action I woud have thought you'd use this instead: action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/web/forms/orderForm.jsp scope=request forward name=success path=/OrderThanks.do/ /action Regards, Geeta Andy Kriger wrote: I am having a curious problem with form validation. I submit a form, see in the logs that the form fails to validate, however, the webapp does not return to the input page (I get a blank page with no HTML in it), so I do not see the form with error messages as expected. If I put text in the field, the form does submit correctly and I see the JSP specified in the resulting action chain. The log files have no error messages indicating something is amiss. When validation fails, the subsequent action is definitely not running (I do not see the logging in the execute method). Does anyone have any ideas what could be happening here? Or how I can track down the problem? Below is the relevant info... === STRUTS CONFIG === action path=/OrderForm forward=/web/forms/orderForm.jsp / action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action action path=/OrderThanks parameter=/web/orderThanks.jsp type=org.apache.struts.actions.ForwardAction/ === orderForm.jsp === logic:messagesPresent html:messages id=err %=err%br/ /html:messages /logic:messagesPresent html:form action=SubmitOrder.do html:text property=firstName styleId=firstName size=20/ html:submit value=Press Me/ /html:form === VALIDATION CONFIG === form name=orderForm field property=firstName depends=required arg0 key=orderForm.firstName.label name=required / /field /form === LOG MESSAGES === [org.apache.struts.action.RequestProcessor][RequestProcessor] Validating input form properties [org.apache.struts.action.RequestProcessor][RequestProcessor] Validation failed, returning to '/OrderForm.do' Andy Kriger | Software Mechanic | Greater Than One, Inc. 28 West 27th Street | 7th Floor | New York, NY 10001 P: 212.252.7197 | F: 212.252.7364 | E: [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: Problems Redirecting To Input Page After Vaildation Fails
- resending: hope this doesn't end up as a duplicate - Another option would be to call the validate() method yourself and return the appropriate forward. add validate=false to your mapping, plus your forms as forwards so you can still configure them in your struts-config: action path=/clientaction type=ie.sentenial.application.actions.ClientAction name=clientForm scope=request validate=false attribute=clientForm forward name=addForm path=/pages/addClient.jsp/ forward name=updateForm path=/pages/updateClient.jsp/ /action - this way, the RequestProcessor won't call validate(). in your action, before you proceed, you can do something similar to: public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ActionErrors errors = form.validate(mapping, request); if ((errors != null) (!errors.isEmpty())) { request.setAttribute(Globals.ERROR_KEY, errors); if (update.equals(request.getParameter(action))) { return mapping.findForward(updateForm); } else { return mapping.findForward(addForm); } } // ... } - Hubert --- Van Riper, Mike [EMAIL PROTECTED] wrote: Ciaran, When all else fails, cut and paste. :-) Seriously, I don't know of a way to make the input value dynamic. I wish it could be done like tile definitions with one action mapping extending another, but, I know that is not supported. So, the simplest solution is to have two separate action mappings for the one action class that supports both adds and updates like so: action path=/clientaction/add type=ie.sentenial.application.actions.ClientAction name=clientForm scope=request input=/pages/addClient.jsp attribute=clientForm /action action path=/clientaction/update type=ie.sentenial.application.actions.ClientAction name=clientForm scope=request input=/pages/updateClient.jsp attribute=clientForm /action You still get code reuse of your action class, but, you have to duplicate the action mapping specification. If you want to avoid duplicating the action mapping, the other way to go is to have a single JSP that supports both adds and updates with conditional logic in the JSP based on a mode parameter which indicates whether it is being used for an add or an update. - Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts/ P.S. You don't need to specify both name and attribute values in your action mappings unless you want to store the form under a different name at request/session scope than the form configuration name. What you have done doesn't hurt anything, it is just not necessary to specify an attribute value unless the value specified for it is different than the name value. -Original Message- From: Ciaran Hanley [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 10:57 AM To: Struts User Mailing List Subject: Problems Redirecting To Input Page After Vaildation Fails Hello can anybody help me with this problem I'm having please? I am using the same action to perform two functions action path=/clientaction type=ie.sentenial.application.actions.ClientAction name=clientForm scope=request input=/pages/addClient.jsp attribute=clientForm /action This is called as follows from 2 different forms: html:form action=/clientaction?action=update focus=clientName onsubmit=return validateClientForm(this) and html:form action=/clientaction?action=add focus=clientName onsubmit=return validateClientForm(this) The problem is that because I have input=/pages/addClient.jsp ...that when a validation fails while doing an update it is directed back to the addClient.jsp rather than the updateClient.jsp As far as I know the input field will not take dynamic values. I am not sure how to resolve this problem. I need to be directed back to the correct page when validations fail Thanks Ciaran __ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: log4j integration
Do you mean changes made after the initial configuration of log4j? You can use PropertyConfigurator.configureAndWatch( cfgFile, delay ) This will load your log4j configuration file and create a thread that looks for changes to the config file reloading when necessary. --Norm -- Norm Deane MIS Consultant Vanderbilt University (615) 322-7855 [EMAIL PROTECTED] -Original Message- From: shankarr [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 9:14 AM To: [EMAIL PROTECTED] Subject: log4j integration Hi! I have integrated log4j with struts. I need to know how to ensure that the changes done to log4j.properties file is taken into account at run time. TIA, Richie To achieve all that is possible, one must attempt the impossible - 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]
Antwort: AW: WebGroups css
After a restart of the server this version works. Thanks, Manuel An 'Struts Users Mailing List' Otto, Frank [EMAIL PROTECTED] [EMAIL PROTECTED] Kopie 27.01.2004 11:10 Thema AW: WebGroups css Bitte antworten an Struts Users Mailing List [EMAIL PROTECTED] org Hi, you can do this in this way (static path to css file): % String context_path = request.getContextPath(); % LINK href=%=context_path%/theme/formats.css rel=stylesheet type=text/css Regards, Frank -Ursprungliche Nachricht- Von: Manuel Lenz [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 27. Januar 2004 09:15 An: Struts Users Mailing List Betreff: WebGroups css Hi you, I do have a silly problem with style sheets-linking. I have a css-File in the folder /theme/formats.css. I access this file from a jsp-page of the folder /help/info.jsp with this link: LINK href=../theme/formats.css rel=stylesheet type=text/css This works, if I call the jsp-Page directly. There is another jsp-page in the folder called /help/infoTest.jsp. This page is called from struts-config with a forward. The page has exactly the same code for linking the css-File. But when the jsp-Page is called, the css-File is not found and the server is showing this message: Web group /theme/formats.css is not defined (Die Webgruppe /theme/formats.css wurde nicht definiert.) Does anybody have an idea how to solve this problem? Manuel - 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: Disable validator framework
Hi, I'm bringing up an old topic here regarding multipage form validation. In the example shown in the previous message, am I suppose to set validate=true in struts-config? If yes, what's the value of the 'input' attribute, since there are multiple pages? Or should I set validate to false and call validate within my action class? Rgds, Patrick. -Original Message- From: Andriy Ruzhevych [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 7:28 PM To: Struts Users Mailing List Subject: RE: Disable validator framework the first you must add the page attribute in your form bean form-bean name=processAdditionalForm type=org.apache.struts.validator.DynaValidatorForm form-property initial=0 name=calculationType type=java.lang.String / form-property name=isTradeUnion type=java.lang.String / form-property name=isDecret type=java.lang.String / form-property initial=0 name=page type=java.lang.Integer / /form-bean and change validation.xml like form name=processAdditionalForm field property=calculationType depends=required,integer page=1 arg0 key=validator.calculationType/ /field field property=isDecret depends=required,integer page=2 arg0 key=validator.isDecret/ /field /form in this case when page=1 then only calculationType validate, when page=2 then calculationType and isDecret validate. when page=n (fields from page attr page=0..n validate) -Original Message- From: Patrick Cheng [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 12:49 PM To: Struts Users Mailing List Subject: RE: Disable validator framework If you want to do validation conditionally, you can disable validation in struts-config, and call 'form.validate' explicitly in the Action class.(base on your condition) About the 'page' attribute, what I don't understand is, how does struts know which fields are in page 1, which fields are in page 2,3,4..., in order to do the validation for the current+previous pages only? Rgds, Patrick. -Original Message- From: Andriy Ruzhevych [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 4:50 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Disable validator framework You can try to use the page attribute of the field element. Only fields with a page attribute value that is equal to or less than the value of the page property on the form JavaBean are processed. This is useful when using a wizard approach to completing a large form, to ensure that a page is not skipped -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 8:34 AM To: 'Struts Users Mailing List' Subject: Disable validator framework Hi We are using dispatch action and validator framework. There is a popup action associated with one button on the form. When the user clicks on this a particular method in the action is called but I don't want to validate the ActionForm because the main form is not submitted. There are other buttons that submit the form and I need a selective validator framework. I know that it is possible if I were to write my own validate() method by checking a particular value in the form. Can I disable the validator similarly ? If this is not possible then I have to abandon the validator. Appreciate ideas. Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ NOD32 1.596 (20040109) Information __ This message was checked by NOD32 antivirus system. http://www.nod32.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] __ NOD32 1.596 (20040109) Information __ This message was checked by NOD32 antivirus system. http://www.nod32.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]
Reg: Exception handling through struts
Hi, I am using the action errors to set the userdefinable description in the action class and setting it in the request so that the description can appear at the JSP using html:errors tag. My requirement is also to show the actual exception at the JSP how can I get this. Any pointers will be useful. Thanks Regards, Satish - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: constant url
Quoting shankarr [EMAIL PROTECTED]: Hi! Thanks for the response. http://localhost:8081/log4jdemo/loginScreen.do is what I see in my url. I would like to keep this a constant at http://localhost:8081/log4jdemo only. I am using both a href and html:link. But, even in cases where i use direct action like /loginScreen.do, on invoking the action, i.e clicking a button, i get the full path in the url. As others have suggested, using frames is an easy way to leave a constant URL showing in the location bar. It works even if you have a frameset with only one frame in it. Another alternative would be to use a little JavaScript to open a window that does not have a location bar, and run your app there. This exposes the data to the hackers and will be a big issue in deployment. I hope you understand that neither of the above techniques, nor pretty much any other hiding technique, will do the slightest bit of good at protecting knowledge of the URLs being used from hackers? The client browser (or application, since hackers have been known to write HTTP client apps that try to act like a browser) sees all the real URLs. So will anyone who can do a View Source on the actual HTML. Controlling the URL in the location bar for aesthetic reasons is fine. Assuming that this would improve the security of your application is a bad mistake. Any help will be appreciated. Richie Craig McClanahan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: log4j integration
Hi! In fact, I got two responses for the question as I had sent the same question twice. My mailbox was acting funny yesterday, so I had to send it twice. Well, I do have the log4j.properties file under web-inf/classes I had thought of using the PropertyConfigurator too. But, when you integrate log4j with struts, we no where mention the log4j.properties file specifically, ie, we just create the file and put it under the mentioned location. And when we use it, we do not mention the log4j.properties file anywhere in the files too. So, how to get a handle to the file? Correct me if there are better approaches to the same. Steps by which I integrated are : a)Got the log4j.jar file b)created the log4j.properties file c)created commons-logging.properties file d) used static logger = new logger(this) in the files where this is the class name. TIA, Richie At 02:28 PM 1/27/2004 -0600, you wrote: Do you mean changes made after the initial configuration of log4j? You can use PropertyConfigurator.configureAndWatch( cfgFile, delay ) This will load your log4j configuration file and create a thread that looks for changes to the config file reloading when necessary. --Norm -- Norm Deane MIS Consultant Vanderbilt University (615) 322-7855 [EMAIL PROTECTED] -Original Message- From: shankarr [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 9:14 AM To: [EMAIL PROTECTED] Subject: log4j integration Hi! I have integrated log4j with struts. I need to know how to ensure that the changes done to log4j.properties file is taken into account at run time. TIA, Richie To achieve all that is possible, one must attempt the impossible - 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 achieve all that is possible, one must attempt the impossible