Log4J and Struts
Hi, where must I put the config-file for Log4J so I can use log4j within struts? Many thanks! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Help with struts model
Happy thanksgiving eveyone! I was hoping someone could give me some help with the best way to use struts in a certain instance. In some of my web apps, there is a set of N pages that have links to each other (in a list across the top of the page, perhaps) and whenever you go between two of those pages, I want to perform an action (say, for example, authorize the user, save some values they've filled out on the page to the db, and then go to the destination page if everything succeeds.) I can see two ways of doing this: First, make N*(N-1) different entries in struts-config.xml, one for each possible path between the two pages. This seems pretty silly to me, and unworkable in the long run. The other way is to pass in the requested destination as a parameter to the action, and create an ActionForward based upon that param. This seems like the only workable solution, but a little contrary to the struts model. Does anyone have a better solution? Or am I just being a little too worried about being purist? The main reason I ask is that I fear establishing a precendent in the development group of having actions use dynamically created ActionForwards based upon input params. In many ways, it's less work... and I think people will use it as an easy way out for the short term, negating much of the declarative value of struts in the long run. Thanks, -Matt -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Please Help!!!
ServiceProvider.date is null. Initialize it to new YourDateClass() (and don't forget to do the same in the reset() method if you're using one). hth, tomK -Original Message- From: Ashoka Murthy [mailto:[EMAIL PROTECTED]] Sent: woensdag 21 november 2001 22:50 To: [EMAIL PROTECTED] Subject: Please Help!!! Could anybody tell me where to find information on how to include beans on your page and also write the corresponding ActionForm for it. I have a form in which I am displaying 2 dates that come from a class Daterange. Now I am calling the dates as :- html:text name=ServiceProvider property=date.displayEffectiveDate size=13/ html:text name=ServiceProvider property=date.displayExpiryDate size=13/ I also have a Actionform called ServiceProviderForm.java which has setDate and getDate methods. When I submit the form, I get the foll. error java.lang.IllegalArgumentException: Null property value for 'date' at org.apache.struts.util.PropertyUtils.setNestedProperty(Propert yUtils.java:776) at org.apache.struts.util.PropertyUtils.setProperty(PropertyUtils .java:825) at org.apache.struts.util.BeanUtils.populate(BeanUtils.java:847) at org.apache.struts.util.BeanUtils.populate(BeanUtils.java:789) at org.apache.struts.action.ActionServlet.processPopulate(ActionS ervlet.java:1803) at org.apache.struts.action.ActionServlet.process(ActionServlet.j ava:1414) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:480) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper .java:405) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextM anager.java:812) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758) at org.apache.tomcat.service.http.HttpConnectionHandler.processCo nnection(HttpConnectionHandler.java:213) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoin t.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPo ol.java:501) at java.lang.Thread.run(Thread.java:484) Please help me :( TIA _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Weblogic pains...
I am trying to get a simple application up and running under Weblogic 5.1 (sp 8) and getting stuck on about the first step :-(. It looks as though struts has problems translating mappings. This is my jsp: %@page contentType=text/html% %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % html:html html:form action='/whatever' /html:form /html:html And the corresponding entry in struts-config.xml is OK, 'cause this displays a fine form tag under Tomcat. Is there some known limitation on Weblogic? I am using prefix matching in my app, could this be the problem? Thanks for any input. PS Upgrading Weblogic is not an option for me: this is part of a larger app. Mark Schenk | Ceci n'est pas une signature Blackboard Project Manager | Delft University of Technology |E-mail: [EMAIL PROTECTED] Dept.: DTO |Phone: +31 152785448 (85448) Room: LB00.680 |Fax:+31 152786359 - -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Log4J and Struts
Somewhere in the classpath. For Tomcat, I put it in TOMCAT_HOME/webapps/myapp/WEB-INF/classes hth, tomK -Original Message- From: storck [mailto:[EMAIL PROTECTED]] Sent: donderdag 22 november 2001 9:30 To: Struts User (E-Mail) Subject: Log4J and Struts Hi, where must I put the config-file for Log4J so I can use log4j within struts? Many thanks! -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts salability
We have a system in production which serves the entire North Sea Offshore and Onshore Installations for BP, serving several thousand concurrent users and performance is excellent (i can provide metrics if you are interested) - although we did have to do the neccessary performance tuning. Generally we found that Struts is the least of your worries when it comes to large scale enterprise deployments - particularly if your software involves EJBs. If you or anyone else would like anymore info, i'd be happy to share more details. On another note, details of the previously mentioned Chiki Wiki built with Struts will be posted soon - the prototype will be available over the web shortly. Cheers Ghoot Emaho Software Development Team Leader www.petrotechnics.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 21 November 2001 18:04 To: [EMAIL PROTECTED] Subject: Struts salability Does anybody know of any issues with Struts with respect to salability ? Is a multiple servlet solution more scalable ? Many Thanks Alan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
AW: Log4J and Struts
i have it in web-inf/classes and will be invoced by a startup servlet. -Ursprüngliche Nachricht- Von: Tom Klaasen (TeleRelay) [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 22. November 2001 10:30 An: Struts Users Mailing List Betreff: RE: Log4J and Struts Somewhere in the classpath. For Tomcat, I put it in TOMCAT_HOME/webapps/myapp/WEB-INF/classes hth, tomK -Original Message- From: storck [mailto:[EMAIL PROTECTED]] Sent: donderdag 22 november 2001 9:30 To: Struts User (E-Mail) Subject: Log4J and Struts Hi, where must I put the config-file for Log4J so I can use log4j within struts? Many thanks! -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Log4J and Struts
Startup servlet? I have no need for that one - either you name your property file log4j.properties, or you specify the environment variable log4j.configuration, and log4j will pick it up by itself. Thus I have _no_ initialization code for log4j. The only things that are changed in my code is import org.apache.log4j.Category; and private static final Category logcat = Category.getInstance(MyClass.class);. This is precisely what makes log4j superior to all other logging mechanisms I've yet seen (though I have to admit I don't study them all, because I'm more than content with log4j). tomK -Original Message- From: juraj Lenharcik [mailto:[EMAIL PROTECTED]] Sent: donderdag 22 november 2001 11:05 To: 'Struts Users Mailing List' Subject: AW: Log4J and Struts i have it in web-inf/classes and will be invoced by a startup servlet. -Ursprüngliche Nachricht- Von: Tom Klaasen (TeleRelay) [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 22. November 2001 10:30 An: Struts Users Mailing List Betreff: RE: Log4J and Struts Somewhere in the classpath. For Tomcat, I put it in TOMCAT_HOME/webapps/myapp/WEB-INF/classes hth, tomK -Original Message- From: storck [mailto:[EMAIL PROTECTED]] Sent: donderdag 22 november 2001 9:30 To: Struts User (E-Mail) Subject: Log4J and Struts Hi, where must I put the config-file for Log4J so I can use log4j within struts? Many thanks! -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Weblogic pains...
Tag attributes need to be double-quoted, but I'd start by describing the problem you are having! I have used Struts with WLS 5.1 and WLS 6.0 and have had no trouble. Sean - Original Message - From: Mark Schenk [EMAIL PROTECTED] To: Struts-User [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 9:28 AM Subject: Weblogic pains... I am trying to get a simple application up and running under Weblogic 5.1 (sp 8) and getting stuck on about the first step :-(. It looks as though struts has problems translating mappings. This is my jsp: %@page contentType=text/html% %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % html:html html:form action='/whatever' /html:form /html:html And the corresponding entry in struts-config.xml is OK, 'cause this displays a fine form tag under Tomcat. Is there some known limitation on Weblogic? I am using prefix matching in my app, could this be the problem? Thanks for any input. PS Upgrading Weblogic is not an option for me: this is part of a larger app. -- -- Mark Schenk | Ceci n'est pas une signature Blackboard Project Manager | Delft University of Technology |E-mail: [EMAIL PROTECTED] Dept.: DTO |Phone: +31 152785448 (85448) Room: LB00.680 |Fax: +31 152786359 -- -- - -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
AW: Log4J and Struts
thanks for the tip. i will try it. - juraj -Ursprüngliche Nachricht- Von: Tom Klaasen (TeleRelay) [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 22. November 2001 11:10 An: Struts Users Mailing List Betreff: RE: Log4J and Struts Startup servlet? I have no need for that one - either you name your property file log4j.properties, or you specify the environment variable log4j.configuration, and log4j will pick it up by itself. Thus I have _no_ initialization code for log4j. The only things that are changed in my code is import org.apache.log4j.Category; and private static final Category logcat = Category.getInstance(MyClass.class);. This is precisely what makes log4j superior to all other logging mechanisms I've yet seen (though I have to admit I don't study them all, because I'm more than content with log4j). tomK -Original Message- From: juraj Lenharcik [mailto:[EMAIL PROTECTED]] Sent: donderdag 22 november 2001 11:05 To: 'Struts Users Mailing List' Subject: AW: Log4J and Struts i have it in web-inf/classes and will be invoced by a startup servlet. -Ursprüngliche Nachricht- Von: Tom Klaasen (TeleRelay) [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 22. November 2001 10:30 An: Struts Users Mailing List Betreff: RE: Log4J and Struts Somewhere in the classpath. For Tomcat, I put it in TOMCAT_HOME/webapps/myapp/WEB-INF/classes hth, tomK -Original Message- From: storck [mailto:[EMAIL PROTECTED]] Sent: donderdag 22 november 2001 9:30 To: Struts User (E-Mail) Subject: Log4J and Struts Hi, where must I put the config-file for Log4J so I can use log4j within struts? Many thanks! -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Options tag question
Are you sure that you can see the scoped bean. Try some debugging to the console. % System.out.println( *ACE* news letter form bean =+ pageContext.findAttribute( newsletterForm ) ); % -- Peter Pilgrim ++44 (0)207-545-9923 //_\\ Mathematics is essentially the study of islands of === disparate subjects in a sea of ignorance. || ! || Andrew Wiles _ Message History From: Tricia Ong Cheah Yen [EMAIL PROTECTED] on 21/11/2001 11:51 ZE8 Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject: RE: Options tag question Peter, When I used the bean:define tag together with html:options. I had first define a bean with a property that contains an ArrayList of LabelValueBeans. But the code fails to work. I'm getting a NullPointerException. bean:define id=travelPeriodList name=newsletterForm property=travelDaysList/ html:select property=targetDuration size=0 value= html:options collection=travelPeriodList property=value labelProperty=label/ /html:select And btw, can someone explains to me what's the difference between scope and toScope? thanks +trish -Original Message- From: Peter Pilgrim [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 20, 2001 10:49 PM To: Struts Users Mailing List Subject: Re: Options tag question Unfortunately the current html:options requires that you use bean:define indirectly to use the tag. define:bean id=brokerLabelValues name=brokerForm property=brokers / html:options collection=brokerLabelValues property=value labelProperty=label / -- Peter Pilgrim ++44 (0)207-545-9923 //_\\ Mathematics is essentially the study of islands of === disparate subjects in a sea of ignorance. || ! || Andrew Wiles _ Message History From: [EMAIL PROTECTED] on 20/11/2001 09:44 EST Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: Options tag question In reworking my Action classes, I tried to package all values needed for my form in the form bean, so I included a property that contains an ArrayList of LabelValueBeans. Can I refer to this property to populate the html:options tag? This nested syntax doesn't seem to work: html:options collection=brokerForm.brokers property=value labelProperty=label / Or should I go back to including the ArrayList as a request attribute and return it that way. Lee -- 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: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- 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: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
disable back button
Steven Elliott, I found this in the archives: http://marc.theaimsgroup.com/?l=struts-userm=100281015318025w=2 Can you describe shortly how this works when using forms? I can't find a way to use window.location.replace() and submitting the form to the server at the same time. tia, tomK -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
query
Hello, Please help us identify a solution to the following requirement in STRUTS perspective: Passing form data from one .jsp to another without sharing a common bean. Regards Sai winmail.dat Description: application/ms-tnef -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to Broadcast to users?
Definitely make you own tag for this purpose ... Haven't tried this, but how about introducing an ActionForm super class (that all your current ActionForms inherit from), if you do not have one already, and define a restart property (I would make it some kind of a timestamp) there. Then make your own tag that renders some comment-box with the date and time of the next restart, if this property is set. Regards, Klaus Bucka-Lassen aragost, Switzerland -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Weblogic pains...
Subject: Re: Weblogic pains... Tag attributes need to be double-quoted, but I'd start by describing the problem you are having! I have used Struts with WLS 5.1 and WLS 6.0 and have had no trouble. %@page contentType=text/html% %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % html:html html:form action='/whatever' /html:form /html:html Oops. Staring at the problem so long I forgot to mention what it is. I get an error 500 in the browser and something like this in my log: Thu Nov 22 12:16:31 CET 2001:E WebAppServletContext-dto-struts-app Root cause of ServletException javax.servlet.ServletException: runtime failure in custom tag 'form' at jsp_servlet._devinfo._jspService(_devinfo.java:111) at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java :106) I tried both quotes and double-quotes: no difference whatsoever. Mark Schenk | Ceci n'est pas une signature Blackboard Project Manager | Delft University of Technology |E-mail: [EMAIL PROTECTED] Dept.: DTO |Phone: +31 152785448 (85448) Room: LB00.680 |Fax:+31 152786359 - -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Weblogic pains...
Do you not have to give the form a name? - Original Message - From: Mark Schenk [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 11:28 AM Subject: RE: Weblogic pains... Subject: Re: Weblogic pains... Tag attributes need to be double-quoted, but I'd start by describing the problem you are having! I have used Struts with WLS 5.1 and WLS 6.0 and have had no trouble. %@page contentType=text/html% %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % html:html html:form action='/whatever' /html:form /html:html Oops. Staring at the problem so long I forgot to mention what it is. I get an error 500 in the browser and something like this in my log: Thu Nov 22 12:16:31 CET 2001:E WebAppServletContext-dto-struts-app Root cause of ServletException javax.servlet.ServletException: runtime failure in custom tag 'form' at jsp_servlet._devinfo._jspService(_devinfo.java:111) at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java :106) I tried both quotes and double-quotes: no difference whatsoever. -- -- Mark Schenk | Ceci n'est pas une signature Blackboard Project Manager | Delft University of Technology |E-mail: [EMAIL PROTECTED] Dept.: DTO |Phone: +31 152785448 (85448) Room: LB00.680 |Fax: +31 152786359 -- -- - -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
How to display an option(s) in a select tag as checked
Hi all I have a select box with several options. I'd like that a particular option is alredy checked when the JSP page is dispayed to the user. How to do that? i.e. html:select property=fanum size=1 style=width:100% html:options collection=RegionalClubs property=value labelProperty=label/ Thank's Roland -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
authorisation
Anybody has examles of authorisation done by struts ActionServlet ? regards Wojtek -- Myslisz o otworzeniu wlasnego sklepu internetowego? A moze o wynajeciu stoiska w wirtualnym pasazu? W Centrum e-biznesu mozesz miec jedno i drugie. Juz od 290 zl za rok. Wybierz: e-witryne lub e-sklep. http://handel.getin.pl/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
General model question ?
Hi everybody, I am new to struts, but I find them very usefull. There is one question that bothers me. Wy is ActionForm a class not an interface ? I have got my own application data model and I would just need to implement the ActionForm to update/input the data via html forms. But it's not possible - I must inherit the struts structure, so I have to create ActionForm with get, set methods and after all copy all properties between my data model and the corresponding ActionForm. Am I misunderstanding something ? regards Wojtek -- Myslisz o otworzeniu wlasnego sklepu internetowego? A moze o wynajeciu stoiska w wirtualnym pasazu? W Centrum e-biznesu mozesz miec jedno i drugie. Juz od 290 zl za rok. Wybierz: e-witryne lub e-sklep. http://handel.getin.pl/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
AW: How to display an option(s) in a select tag as checked
Hello I used the code below form:select style='FONT-SIZE: xx-small; WIDTH: 189px; size:1' name='AuditActionFormBean' property=selectedstatus onchange='form.submit()' form:options name=AuditActionFormBean property=listauditstatus/ /form:select and my formbean has these properties, private Vector listauditstatus; private String selectedstatus; it works quite fine. So, you don't need to do additional thing. If you want to get a specific option, make sure that you have sent selectedstatus. For example, manually write audit.do?selectedstatus=4 But if you don't want to send selectedstatus, you have to add value property of select. fehmi. -Ursprüngliche Nachricht- Von: Roland Berger [mailto:[EMAIL PROTECTED]] Gesendet am: Thursday, November 22, 2001 1:39 PM An: Struts Mailinglist Betreff: How to display an option(s) in a select tag as checked Hi all I have a select box with several options. I'd like that a particular option is alredy checked when the JSP page is dispayed to the user. How to do that? i.e. html:select property=fanum size=1 style=width:100% html:options collection=RegionalClubs property=value labelProperty=label/ Thank's Roland -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
maxlength
hi all we dont have any maxlength attribute for textArea in struts, can anyone tell me how to give a restriction on input characters on text area field thanks a lot in advance mahesh -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
AW: Log4J and Struts
Hi, We have subclassed the ActionServlet and loaded the our log4j Config file in the servlet init() method. You can put the config where you like - we specify the location in a Servlet initialisation parameter. We prefer to use a config file since we can configure our categories in one place. If you are just using the root category with no special appender a config file is probably sufficient. Have fun ! Ben -Ursprüngliche Nachricht- Von: Tom Klaasen (TeleRelay) [mailto:[EMAIL PROTECTED]] Gesendet am: Thursday, November 22, 2001 11:10 AM An: Struts Users Mailing List Betreff: RE: Log4J and Struts Startup servlet? I have no need for that one - either you name your property file log4j.properties, or you specify the environment variable log4j.configuration, and log4j will pick it up by itself. Thus I have _no_ initialization code for log4j. The only things that are changed in my code is import org.apache.log4j.Category; and private static final Category logcat = Category.getInstance(MyClass.class);. This is precisely what makes log4j superior to all other logging mechanisms I've yet seen (though I have to admit I don't study them all, because I'm more than content with log4j). tomK -Original Message- From: juraj Lenharcik [mailto:[EMAIL PROTECTED]] Sent: donderdag 22 november 2001 11:05 To: 'Struts Users Mailing List' Subject: AW: Log4J and Struts i have it in web-inf/classes and will be invoced by a startup servlet. -Ursprüngliche Nachricht- Von: Tom Klaasen (TeleRelay) [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 22. November 2001 10:30 An: Struts Users Mailing List Betreff: RE: Log4J and Struts Somewhere in the classpath. For Tomcat, I put it in TOMCAT_HOME/webapps/myapp/WEB-INF/classes hth, tomK -Original Message- From: storck [mailto:[EMAIL PROTECTED]] Sent: donderdag 22 november 2001 9:30 To: Struts User (E-Mail) Subject: Log4J and Struts Hi, where must I put the config-file for Log4J so I can use log4j within struts? Many thanks! -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts salability
Hi I'd be very interested in any performance figures you can provide, and the type of architecture you have deployed to ensure performance and scalability. I'm currently considering struts for a large project, and finding large commercial deployments for reference is hard. Also if you could give any info on the servers you are using, that would be appreciated. Thanks in advance, Kev -Original Message- From: Emaho, Ghoot [mailto:[EMAIL PROTECTED]] Sent: 22 November 2001 09:30 To: Struts Users Mailing List Subject: RE: Struts salability We have a system in production which serves the entire North Sea Offshore and Onshore Installations for BP, serving several thousand concurrent users and performance is excellent (i can provide metrics if you are interested) - although we did have to do the neccessary performance tuning. Generally we found that Struts is the least of your worries when it comes to large scale enterprise deployments - particularly if your software involves EJBs. If you or anyone else would like anymore info, i'd be happy to share more details. On another note, details of the previously mentioned Chiki Wiki built with Struts will be posted soon - the prototype will be available over the web shortly. Cheers Ghoot Emaho Software Development Team Leader www.petrotechnics.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 21 November 2001 18:04 To: [EMAIL PROTECTED] Subject: Struts salability Does anybody know of any issues with Struts with respect to salability ? Is a multiple servlet solution more scalable ? Many Thanks Alan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
HelloWorld example
Hello, Struts guru! I am a dummy in Struts technology. Can anyone please send me some urls or docs of simple HelloWorld Struts-example? The example in Struts distibution is too sophisticated for getting started. With best wishes, Alexey.
AW: HelloWorld example
Hi, you might want to check out some of the links that you can find at http://www.husted.com/struts/resources.htm#tutorials there are a couple of tutorials listed which really help you to get started (e.g the Welcome to the Struts Framework by Bluestone Software link). good luck, Martin -Ursprungliche Nachricht- Von: Alexey Kovjazin [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 22. November 2001 14:51 An: [EMAIL PROTECTED] Betreff: HelloWorld example Hello, Struts guru! I am a dummy in Struts technology. Can anyone please send me some urls or docs of simple HelloWorld Struts-example? The example in Struts distibution is too sophisticated for getting started. With best wishes, Alexey. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
OFFT: base for file reading in WEB apps
Hi! I know that this is totally off topic, but what is file base for file operations for classes running in servlet container (Tomcat in my case). For example if I have app.properties file in WEB-INF directory, what should be the path I need to use to open this file? WBR, Gundars Kulups Project manager A/S Dati Phone: +371-7067713 Mobile: +371-9466055 Fax: +371-7619573 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Log4J and Struts
Startup servlet? I have no need for that one - either you name your property file log4j.properties, or you specify the environment variable log4j.configuration, and log4j will pick it up by itself. Remember that this doesn't work if log4j as been already configured elsewhere. F.e. this happens if you use JBoss with embedded Tomcat (which uses log4j for its own logging purposes). The init servlet approach is guaranteed to work everytime and everywhere, that's why I prefer it. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Log4J and Struts
OK, didn't know that. I've only used Tomcat so far (and SilverStream in a dark and far-away past) tomK -Original Message- From: Stefano Mancarella [mailto:[EMAIL PROTECTED]] Sent: donderdag 22 november 2001 15:22 To: Struts Users Mailing List Subject: Re: Log4J and Struts Startup servlet? I have no need for that one - either you name your property file log4j.properties, or you specify the environment variable log4j.configuration, and log4j will pick it up by itself. Remember that this doesn't work if log4j as been already configured elsewhere. F.e. this happens if you use JBoss with embedded Tomcat (which uses log4j for its own logging purposes). The init servlet approach is guaranteed to work everytime and everywhere, that's why I prefer it. -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: HelloWorld example
Thank you, Martin! - Original Message - From: Mooslechner Martin [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: 11/22/2001 4:56 PM Subject: AW: HelloWorld example Hi, you might want to check out some of the links that you can find at http://www.husted.com/struts/resources.htm#tutorials there are a couple of tutorials listed which really help you to get started (e.g the Welcome to the Struts Framework by Bluestone Software link). good luck, Martin -Ursprungliche Nachricht- Von: Alexey Kovjazin [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 22. November 2001 14:51 An: [EMAIL PROTECTED] Betreff: HelloWorld example Hello, Struts guru! I am a dummy in Struts technology. Can anyone please send me some urls or docs of simple HelloWorld Struts-example? The example in Struts distibution is too sophisticated for getting started. With best wishes, Alexey. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Weblogic pains...
I've never seen the errors you are getting, sorry... I've seen Struts work with Weblogic for what that's worth. Since the JSP exceptions aren't very helpful I might resort to debugging it line by line! See where Struts is really complaining. Regarding double quotes, I guess I was thinking of XML... sure enough single quotes are OK with JSP; I learn something new every day. - Original Message - From: Mark Schenk [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 1:06 PM Subject: RE: Weblogic pains... Do you not have to give the form a name? Nope, struts uses the default bean defined in struts-config: action path=/whatever name=whateverformbean scope=request ... And the form bean works... (as it IS created when I run it in tomcat...) PS. You had me worried about having to use double quotes so I looked it up the jsp-specs: section 2.1.5 states you can use both single and double quotes. -- -- Mark Schenk | Ceci n'est pas une signature Blackboard Project Manager | Delft University of Technology |E-mail: [EMAIL PROTECTED] Dept.: DTO |Phone: +31 152785448 (85448) Room: LB00.680 |Fax: +31 152786359 -- -- - -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
AW: OFFT: base for file reading in WEB apps
Hi Gundars, you can get the Base-Path by using the getServletContext().getRealPath()-Method in the ActionServlet. Björn -Ursprüngliche Nachricht- Von: Gundars Kulups [SMTP:[EMAIL PROTECTED]] Gesendet am: Donnerstag, 22. November 2001 15:12 An: [EMAIL PROTECTED] Betreff: OFFT: base for file reading in WEB apps Hi! I know that this is totally off topic, but what is file base for file operations for classes running in servlet container (Tomcat in my case). For example if I have app.properties file in WEB-INF directory, what should be the path I need to use to open this file? WBR, Gundars Kulups Project manager A/S Dati Phone: +371-7067713 Mobile: +371-9466055 Fax: +371-7619573 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Want to check user is logged in every page server
create a bean that represents a user during the login-action processing. add it to the session in your action. on every following page, do a check for a bean representing the user. if not present, do a forward to the login-page. logic:notPresent name=user scope=session html:link forward=/login.jsp. greetings, thorsten - Original Message - From: [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, November 20, 2001 10:41 AM Subject: Want to check user is logged in every page server : Hi : : Everytime a page is served from my Struts application, I want to check : to make sure the user is logged in. If they are not then I want to send : them to the login screen. What is the best way to go about this using : Struts? : : Cheers : : Tony : : : -- : To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] : For additional commands, e-mail: mailto:[EMAIL PROTECTED] : -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: All the jar files cann't be read
I put the struts.jar file in that folder and put it into my classpath. Maybe that is the reason why it shows that path. May I ask where I could config this ? By the way, I still got blank page but if I click view source, I can see all the jsp code is there, which means that all the taglib or related lib files could not be found or linked. I think I put all the lib files in right place. May I ask where I could config this path other than at the top of each JSP page ? Tons of thanks. Lily -Original Message- From: Brett Porter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 21, 2001 6:04 PM To: 'Struts Users Mailing List' Subject: RE: All the jar files cann't be read That's a normal message in startup. However, the directory looks a bit suspect - there should be a WEB-INF/lib somewhere in there. eg here is mine: register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'jar:file:/home/bporter/cvs/shopping/product-db/tomcat/webapps/shopping/WEB- INF/lib/struts.jar!/org/apache/struts/resources/struts-config_1_0.dtd' for me, CATALINA_BASE = /home/bporter/cvs/shopping/product-db/tomcat -Original Message- From: Lily Zou [mailto:[EMAIL PROTECTED]] Sent: Thursday, 22 November 2001 9:24 AM To: Struts Users Mailing List Subject: RE: All the jar files cann't be read Thank you very much, Brett. The jar file did corrupted even though I just copied from somewhere else. This time I got: register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'jar:file:/C:/opt/redknee/product/s2100/1_0_1/lib/struts.jar!/org/apache/str uts/resources/struts-config_1_0.dtd' New org.apache.struts.action.ActionMapping May I ask why I got this ? Lily -Original Message- From: Brett Porter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 21, 2001 5:09 PM To: 'Struts Users Mailing List' Subject: RE: All the jar files cann't be read My guess is that it got corrupted in the download, or perhaps because you have two paths in the webapp name (s2100\si) - I've never seen that before, not sure if it should work. Can you unjar the struts.jar file manually into a temp dir to check it is not corrupt? - Brett -Original Message- From: Lily Zou [mailto:[EMAIL PROTECTED]] Sent: Thursday, 22 November 2001 9:06 AM To: 'Struts Users Mailing List' Subject: All the jar files cann't be read I put struts.jar and commons-*.jar file under WEB-INF\lib folder. However every time I started tomcat, I got following error msg ( every time it complains different jar file name ) and the page is just blank. Could anybody tell me what is the most likely reseason for this ? I am the first person in my company to try struts so I have no help around. Looking forward to any advice. cannot load servlet name: jsp: C:\opt\redknee\product\s2100\1_0_1\webapps\s2100\si\WEB-INF\lib\struts.jar is not a directory or zip/jar file or if it's a zip/ja r file then it is corrupted. register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'jar:file:/C:/opt/redknee/product/s2100/1_0_1/lib/struts.jar!/org/apache/str uts/resources/struts-config_1_0.dtd' resolveEntity('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd') Resolving to alternate DTD 'jar:file:/C:/opt/redknee/product/s2100/1_0_1/lib/struts.jar!/org/apache/str uts/resources/struts-config_1_0.dtd' New org.apache.struts.action.ActionMapping Set org.apache.struts.action.ActionMapping properties Call org.apache.struts.action.ActionServlet.addMapping(ActionMapping[path=/admin/ addFormBean, type=org.apache.struts.actions.AddFormBeanAction]) Pop org.apache.struts.action.ActionMapping Lily -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Question ...RE: Want to check user is logged in every page server
Hi, Actually I encountered same problem and solved it as this way,but I have another question. In my logon action, I set up the session max inactive Interval like this request.getSession().setMaxInactiveInterval(900), I think the unit should be second(not sure). The problem is that how can I disable the flash for my logon page ? when I flash logon.do, the browser shows that this page can not be flashed, but I did, I still get the old session alive,the logon session is still availabe. I means once I logon, even I restart my server, I can still flash my jsp page to got my logon page available,the logon is still available, what I hope to display the session is expired and need to logon again, I am still studying how to do that? nay body has any idea? thanks first! Barry -Original Message- From: Thorsten Frank [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 10:10 AM To: Struts Users Mailing List Subject: Re: Want to check user is logged in every page server create a bean that represents a user during the login-action processing. add it to the session in your action. on every following page, do a check for a bean representing the user. if not present, do a forward to the login-page. logic:notPresent name=user scope=session html:link forward=/login.jsp. greetings, thorsten - Original Message - From: [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, November 20, 2001 10:41 AM Subject: Want to check user is logged in every page server : Hi : : Everytime a page is served from my Struts application, I want to check : to make sure the user is logged in. If they are not then I want to send : them to the login screen. What is the best way to go about this using : Struts? : : Cheers : : Tony : : : -- : To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] : For additional commands, e-mail: mailto:[EMAIL PROTECTED] : -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
design question
Hello I have several questions about design, best practises: 1) Where to store client's profile information (like login name) ? session or system state bean ? 2) How to create and use a system state bean ? System state bean should be in scope session, shouldnt it ? 3) Where to put business logic (where I invoke JDBC) ? Should business logic class be a bean ? thanx in advance Maris Orbidans -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: OFFT: base for file reading in WEB apps
Be careful here - getRealPath() can return null when the application is deployed in a WAR if the app server does not expand it (some app server do in fact serve the files straight from the WAR). I got bitten by this recently. Instead try looking at the getResource() and getResourceAsStream() methods. Kev -Original Message- From: Moritz Björn-Hendrik, HH [mailto:[EMAIL PROTECTED]] Sent: 22 November 2001 14:42 To: 'Struts Users Mailing List' Subject: AW: OFFT: base for file reading in WEB apps Hi Gundars, you can get the Base-Path by using the getServletContext().getRealPath()-Method in the ActionServlet. Björn -Ursprüngliche Nachricht- Von:Gundars Kulups [SMTP:[EMAIL PROTECTED]] Gesendet am:Donnerstag, 22. November 2001 15:12 An: [EMAIL PROTECTED] Betreff:OFFT: base for file reading in WEB apps Hi! I know that this is totally off topic, but what is file base for file operations for classes running in servlet container (Tomcat in my case). For example if I have app.properties file in WEB-INF directory, what should be the path I need to use to open this file? WBR, Gundars Kulups Project manager A/S Dati Phone: +371-7067713 Mobile: +371-9466055 Fax: +371-7619573 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts salability
Hi I have received a number of emails asking for more detailed info on our perfromance metrics and tuning techniques as well as our architecture and deployment hardware. I will endeavour to post details over the next few days, but as a prelude here are some things to ponder over. As previously stated, in our experience, the usage of Struts didnt even factor into our tuning work as with large scale systems there are so many other things that can impede performance that Struts effect was negligable at most ! However, I understand that initially this can be a concern for developers and especially management. But with experience it is clear that Struts is definately an aid and not a hindrance or impediment to performance. I will provide as much detail as I can to demonstrate this clearly. To put it into perspective for some of you who have requested details on our techniques and strategies - we had a team working on optimisation over a period of several months. This is not a trivial exercise ! I can give you pointers on best practises, but it should be stated that this is a topic for very experienced and brave developers ![we deployed the first production EJB Web application in the UK when EJBs were pre 1.0] Also I dont want to get anyone's hopes up that I'll provide you with exact methodologies that will solve all problems - it'd take too long and this mail group isnt really a suitable forum. Suffice to say that it is a job which requires rigorous attention to detail and is never a one man job [in our experience] Anyway, I just wanted to post an initial response to the mail I had received and to let people know I will respond - but you will have to be a little patient with me ! I will try and produce as helpful a guide as possible, but it will be a couple of days at least before something appears here (i have a job to do !) When you consider such factors as Architecture, Application Design, EJB usage, Database Design, Network Infrastructure [our deployed environments include bandwidths from 56k to 10M, including Satellite links !], as well as Standard of Coding and usage of Industry Best Practises, Application Server/Web Server choice, hardware, (breath in), the usage of Struts is wy down the list of things that can affect performance. [and that list is by no means complete - just a few off the top of my head] Thanks Ghoot Emaho PS For those you emailed me in person, I will respond in person, but again, give me a few days. Thanks. -Original Message- From: Kevin A. Palfreyman [mailto:[EMAIL PROTECTED]] Sent: 22 November 2001 13:40 To: Struts Users Mailing List Subject: RE: Struts salability Hi I'd be very interested in any performance figures you can provide, and the type of architecture you have deployed to ensure performance and scalability. I'm currently considering struts for a large project, and finding large commercial deployments for reference is hard. Also if you could give any info on the servers you are using, that would be appreciated. Thanks in advance, Kev -Original Message- From: Emaho, Ghoot [mailto:[EMAIL PROTECTED]] Sent: 22 November 2001 09:30 To: Struts Users Mailing List Subject: RE: Struts salability We have a system in production which serves the entire North Sea Offshore and Onshore Installations for BP, serving several thousand concurrent users and performance is excellent (i can provide metrics if you are interested) - although we did have to do the neccessary performance tuning. Generally we found that Struts is the least of your worries when it comes to large scale enterprise deployments - particularly if your software involves EJBs. If you or anyone else would like anymore info, i'd be happy to share more details. On another note, details of the previously mentioned Chiki Wiki built with Struts will be posted soon - the prototype will be available over the web shortly. Cheers Ghoot Emaho Software Development Team Leader www.petrotechnics.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 21 November 2001 18:04 To: [EMAIL PROTECTED] Subject: Struts salability Does anybody know of any issues with Struts with respect to salability ? Is a multiple servlet solution more scalable ? Many Thanks Alan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: another beginner's question - solved
Another day, another question. Why are my form data destroyed? I have 2 forms. When I fill wrong data into 1st form and click html:submit data are here. But when I click back on 2nd form and come back to the 1st one data are missing. SOLVED: From 2nd form I go back with link to .jsp, not link to .do -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: OFFT: base for file reading in WEB apps
Hi Gundars I have used new FileInputStream(servlet.properties) with no problems but then servlet.properties should be in Tomcat /bin directory. Method getClass().getResourceAsStream(servlet.properties); will work if you have the file in the classpath. regards Maris Orbidans DataPro private String getPropertyFromFile(String name) throws ServletException { try { Properties dbProps = new Properties(); // InputStream propStream = getClass().getResourceAsStream(/servlet.properties); InputStream propStream = new FileInputStream(servlet.properties); dbProps.load(propStream); String param = dbProps.getProperty(name); propStream.close(); return param; } catch (Exception e) { log(Error loading properties+e.toString()); throw new ServletException(); } } -Original Message- From: Kevin A. Palfreyman [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 7:21 PM To: Struts Users Mailing List Subject: RE: OFFT: base for file reading in WEB apps Be careful here - getRealPath() can return null when the application is deployed in a WAR if the app server does not expand it (some app server do in fact serve the files straight from the WAR). I got bitten by this recently. Instead try looking at the getResource() and getResourceAsStream() methods. Kev -Original Message- From: Moritz Björn-Hendrik, HH [mailto:[EMAIL PROTECTED]] Sent: 22 November 2001 14:42 To: 'Struts Users Mailing List' Subject: AW: OFFT: base for file reading in WEB apps Hi Gundars, you can get the Base-Path by using the getServletContext().getRealPath()-Method in the ActionServlet. Björn -Ursprüngliche Nachricht- Von:Gundars Kulups [SMTP:[EMAIL PROTECTED]] Gesendet am:Donnerstag, 22. November 2001 15:12 An: [EMAIL PROTECTED] Betreff:OFFT: base for file reading in WEB apps Hi! I know that this is totally off topic, but what is file base for file operations for classes running in servlet container (Tomcat in my case). For example if I have app.properties file in WEB-INF directory, what should be the path I need to use to open this file? WBR, Gundars Kulups Project manager A/S Dati Phone: +371-7067713 Mobile: +371-9466055 Fax: +371-7619573 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
placing a value to a button
Hi! How can I place a value which is read from the applicationresource.properties to a button? Coz it gives me an error message when i try to do this: html:button value=%bean:message key=button.message / / Thanx in advance h -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: placing a value to a button
html:submit property=prevbean:message key=button.prev//html:submit Maris -Original Message- From: Henrick Chua [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 7:38 PM To: Struts Users Mailing List (E-mail) Subject: placing a value to a button Hi! How can I place a value which is read from the applicationresource.properties to a button? Coz it gives me an error message when i try to do this: html:button value=%bean:message key=button.message / / Thanx in advance h -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: placing a value to a button
thanx. -Original Message- From: Maris Orbidans [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 9:41 AM To: Struts Users Mailing List Subject: RE: placing a value to a button html:submit property=prevbean:message key=button.prev//html:submit Maris -Original Message- From: Henrick Chua [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 7:38 PM To: Struts Users Mailing List (E-mail) Subject: placing a value to a button Hi! How can I place a value which is read from the applicationresource.properties to a button? Coz it gives me an error message when i try to do this: html:button value=%bean:message key=button.message / / Thanx in advance h -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
comments
hi all! how can I comment out struts code? do i do it like any other html comments? !-- bean:write property=abc name=def / -- thanx h -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: comments
Yes JSP have the same comment Maris -Original Message- From: Henrick Chua [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 8:12 PM To: Struts Users Mailing List (E-mail) Subject: comments hi all! how can I comment out struts code? do i do it like any other html comments? !-- bean:write property=abc name=def / -- thanx h -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: comments
No! JSP Comments are not !-- -- but %-- --% -- gR - Original Message - From: Maris Orbidans [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 7:14 PM Subject: RE: comments Yes JSP have the same comment Maris -Original Message- From: Henrick Chua [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 8:12 PM To: Struts Users Mailing List (E-mail) Subject: comments hi all! how can I comment out struts code? do i do it like any other html comments? !-- bean:write property=abc name=def / -- thanx h -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: comments
Both comments will work, but !-- -- will be visible by client (as HTML comment). %-- --% will be ignored completely. Maris -Original Message- From: Gregor Rayman [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 8:16 PM To: Struts Users Mailing List Subject: Re: comments No! JSP Comments are not !-- -- but %-- --% -- gR - Original Message - From: Maris Orbidans [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 7:14 PM Subject: RE: comments Yes JSP have the same comment Maris -Original Message- From: Henrick Chua [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 8:12 PM To: Struts Users Mailing List (E-mail) Subject: comments hi all! how can I comment out struts code? do i do it like any other html comments? !-- bean:write property=abc name=def / -- thanx h -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Ant in VAJ 3.5.3
Hello, I am trying to build Struts from source, in VAJ 3.5.3. Do I need to install ANT in my workspace ? Thank you, C. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Design question - Action Form vs Business Delegates/Value Objects
Hello, we're working on a quite large project with J2EE (including EJBs) and we're using Struts (we're still in the early phases). To design a clean application, I've defined different object conversions: * Request phase - the ActionForm is converted to a Value Object - the Value Object is passed to the EJBs * Response phase - the EJBs return one ore more Value Objects - the Value Object(s) is (are) converted back to ActionForms. I think it's a good approach, but: - my ActionForm and Value Objects have an almost identical interface. The main difference is that the ActionForm instance variables are always of type String while for the Value Object have final types information (Date, Integer, whatever) - the conversion ActionForm to VO and back is slowing down the performance as my EJBs often return hundreds of VOs (each one to be converted to an ActionForm). I know this can be improved by using paging (Page-by-Page iterator) on both the back-end and the front-end; furthermore, I've written a small mapper that uses extensively the Reflection API to automatically perform the mapping and this probably has an impact on the overall performance. My question is: what are the best practices for this type of issues? Does anybody have the same problems? Should I reduce the level of abstraction between the layers? Thank you! Andrej PS. if you're interested, I can share the simple mapper. It's a very small mapper (less than 15k) that works fine with my app. It's waaay less complete than the mapper on Ted Husted's site but... -Original Message- From: Jon.Ridgway [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 12:10 PM To: 'Struts Users Mailing List' Subject: RE: design question -Original Message- From: M`ris Orbid`ns [mailto:[EMAIL PROTECTED]] Sent: 22 November 2001 16:54 To: Struts-list (E-mail) Subject: design question Hello I have several questions about design, best practises: 1) Where to store client's profile information (like login name) ? session or system state bean ? Use the HttpSession. But be aware that you should put as little as possible into the session. Large sessions do not work well in a cluster. 2) How to create and use a system state bean ? System state bean should be in scope session, shouldnt it ? Again put as little as possible in the session and avoid statefull session beans. If you must put a bean in the session, make it as small as possible, ideally it would just hold key info that can be used to request beans at request level when needed. This is a trade off between performance and scalability. 3) Where to put business logic (where I invoke JDBC) ? Should business logic class be a bean ? If you have an app server business logic should go into a stateless session bean (BusinessService), which is invoked (via a BusinessDelegate) from a struts Action class. If you are not using EJBs then the Action class should still invoke a business delegate, but the delegate would simply create a normal Java bean to act as the Business Service. The business service (Stateless EJB or Java Bean) should delegate to another class to access a datasource. If your are using EJBs this should be a CMP or BMP+DAO depending on your app server (EJB 2 compliant consider CMP, else try CMP if supported but be prepared to subclass to a BMP+DAO at a later date). thanx in advance Maris Orbidans Jon Ridgway. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: comments
Careful: !-- jsptag / -- The JSP tag will be evaluated (though not shown on the browser since the results will be commented out. And yes, they'll be visible by the client. %-- jsptag / --% The JSP is not evaluated and the commented part will not be sent to the resulting HTML page At least I think.. :) Andrej -Original Message- From: Maris Orbidans [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 1:27 PM To: Struts Users Mailing List Subject: RE: comments Both comments will work, but !-- -- will be visible by client (as HTML comment). %-- --% will be ignored completely. Maris -Original Message- From: Gregor Rayman [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 8:16 PM To: Struts Users Mailing List Subject: Re: comments No! JSP Comments are not !-- -- but %-- --% -- gR - Original Message - From: Maris Orbidans [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 7:14 PM Subject: RE: comments Yes JSP have the same comment Maris -Original Message- From: Henrick Chua [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 8:12 PM To: Struts Users Mailing List (E-mail) Subject: comments hi all! how can I comment out struts code? do i do it like any other html comments? !-- bean:write property=abc name=def / -- thanx h -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
dynamic images
Hi! how can I display images whose source URL comes from the database? and how can I display it's corresponding alt property? I keep getting an error message on this code: html:img src=bean:write name=card property=imageLink width=168.5 height=88 border=1 align=texttop alt =bean:write name=card property=imageDescription / thanx. h -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Design question - Action Form vs Business Delegates/Value Objects
Hi, I suggest to not duplicate variables that are in your Value Objects in your form object. Instead include the value object as a member of the the form object. ie. Form class - below the AccountVo is a value object within the form bean public class AddAccountForm extends ActionForm { public AccountVo getAccount() { return account; } public void setAccount(AccountVo aAccount) { account = aAccount; } } Then, in your jsp you reference the accountvo members like so using the dot notation -- the property account.password gets converted to getAccount().getPassword() or getAccount().setPassword(value). strutshtml:password property=account.password size=30 maxlength=10 / strutshtml:text property=account.accountName testexpr=eMail size=60 maxlength=100 / This feature of struts/javabeans is a real time saver in terms of development. Once something is in a value object then that value object gets passed from the back-end all the way to the front end without needing to touch any of it's attributes. And if you're editing the data on a web page when you submit the page the new data automatically gets set into the value object which can then be passed to the back end (no unnecessary handling of the data). HTH, Michelle From: Sobkowski, Andrej [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: Design question - Action Form vs Business Delegates/Value Objects Date: Thu, 22 Nov 2001 13:28:05 -0500 Hello, we're working on a quite large project with J2EE (including EJBs) and we're using Struts (we're still in the early phases). To design a clean application, I've defined different object conversions: * Request phase - the ActionForm is converted to a Value Object - the Value Object is passed to the EJBs * Response phase - the EJBs return one ore more Value Objects - the Value Object(s) is (are) converted back to ActionForms. I think it's a good approach, but: - my ActionForm and Value Objects have an almost identical interface. The main difference is that the ActionForm instance variables are always of type String while for the Value Object have final types information (Date, Integer, whatever) - the conversion ActionForm to VO and back is slowing down the performance as my EJBs often return hundreds of VOs (each one to be converted to an ActionForm). I know this can be improved by using paging (Page-by-Page iterator) on both the back-end and the front-end; furthermore, I've written a small mapper that uses extensively the Reflection API to automatically perform the mapping and this probably has an impact on the overall performance. My question is: what are the best practices for this type of issues? Does anybody have the same problems? Should I reduce the level of abstraction between the layers? Thank you! Andrej PS. if you're interested, I can share the simple mapper. It's a very small mapper (less than 15k) that works fine with my app. It's waaay less complete than the mapper on Ted Husted's site but... -Original Message- From: Jon.Ridgway [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 12:10 PM To: 'Struts Users Mailing List' Subject: RE: design question -Original Message- From: M`ris Orbid`ns [mailto:[EMAIL PROTECTED]] Sent: 22 November 2001 16:54 To: Struts-list (E-mail) Subject: design question Hello I have several questions about design, best practises: 1) Where to store client's profile information (like login name) ? session or system state bean ? Use the HttpSession. But be aware that you should put as little as possible into the session. Large sessions do not work well in a cluster. 2) How to create and use a system state bean ? System state bean should be in scope session, shouldnt it ? Again put as little as possible in the session and avoid statefull session beans. If you must put a bean in the session, make it as small as possible, ideally it would just hold key info that can be used to request beans at request level when needed. This is a trade off between performance and scalability. 3) Where to put business logic (where I invoke JDBC) ? Should business logic class be a bean ? If you have an app server business logic should go into a stateless session bean (BusinessService), which is invoked (via a BusinessDelegate) from a struts Action class. If you are not using EJBs then the Action class should still invoke a business delegate, but the delegate would simply create a normal Java bean to act as the Business Service. The business service (Stateless EJB or Java Bean) should delegate to another class to access a datasource. If your are using EJBs this should be a CMP or BMP+DAO depending on your app server (EJB 2 compliant consider CMP, else try CMP if supported but be prepared to subclass to a BMP+DAO at a later date). thanx in advance Maris Orbidans Jon Ridgway. -- To unsubscribe, e-mail:
RE: Design question - Action Form vs Business Delegates/Value Objects
Michelle, thanks for your reply... but I'm not sure I understand your answer. Probably my message wasn't clear. To use an example, I have: EmployeeForm extends ActionForm +getName():String +getAge():String +getDateOfBirth():String EmployeeVO +getName():String +getAge():Integer +getDateOfBirth():Date EmployeeForm is a simple Struts mapping of the data displayed on the HTML page. EmployeeVO is the intermediate value/business object where the fields have a real meaning (a Date is a Date). I don't see the reasons of making EmployeeVO an instance variable of EmployeeForm. And EmployeeVO can not be used directly inside Struts to map data from an HttpRequest because (I think) that only Strings (and int?) can be handled in ActionForms. My question was somehow: should I get rid of EmployeeVO? It certainly makes the application cleaner but it may just be a picky thing that will simply waste resources. Thanks. Andrej -Original Message- From: Michelle Popovits [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 4:13 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Design question - Action Form vs Business Delegates/Value Objects Hi, I suggest to not duplicate variables that are in your Value Objects in your form object. Instead include the value object as a member of the the form object. ie. Form class - below the AccountVo is a value object within the form bean public class AddAccountForm extends ActionForm { public AccountVo getAccount() { return account; } public void setAccount(AccountVo aAccount) { account = aAccount; } } Then, in your jsp you reference the accountvo members like so using the dot notation -- the property account.password gets converted to getAccount().getPassword() or getAccount().setPassword(value). strutshtml:password property=account.password size=30 maxlength=10 / strutshtml:text property=account.accountName testexpr=eMail size=60 maxlength=100 / This feature of struts/javabeans is a real time saver in terms of development. Once something is in a value object then that value object gets passed from the back-end all the way to the front end without needing to touch any of it's attributes. And if you're editing the data on a web page when you submit the page the new data automatically gets set into the value object which can then be passed to the back end (no unnecessary handling of the data). HTH, Michelle From: Sobkowski, Andrej [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: Design question - Action Form vs Business Delegates/Value Objects Date: Thu, 22 Nov 2001 13:28:05 -0500 Hello, we're working on a quite large project with J2EE (including EJBs) and we're using Struts (we're still in the early phases). To design a clean application, I've defined different object conversions: * Request phase - the ActionForm is converted to a Value Object - the Value Object is passed to the EJBs * Response phase - the EJBs return one ore more Value Objects - the Value Object(s) is (are) converted back to ActionForms. I think it's a good approach, but: - my ActionForm and Value Objects have an almost identical interface. The main difference is that the ActionForm instance variables are always of type String while for the Value Object have final types information (Date, Integer, whatever) - the conversion ActionForm to VO and back is slowing down the performance as my EJBs often return hundreds of VOs (each one to be converted to an ActionForm). I know this can be improved by using paging (Page-by-Page iterator) on both the back-end and the front-end; furthermore, I've written a small mapper that uses extensively the Reflection API to automatically perform the mapping and this probably has an impact on the overall performance. My question is: what are the best practices for this type of issues? Does anybody have the same problems? Should I reduce the level of abstraction between the layers? Thank you! Andrej PS. if you're interested, I can share the simple mapper. It's a very small mapper (less than 15k) that works fine with my app. It's waaay less complete than the mapper on Ted Husted's site but... -Original Message- From: Jon.Ridgway [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 12:10 PM To: 'Struts Users Mailing List' Subject: RE: design question -Original Message- From: M`ris Orbid`ns [mailto:[EMAIL PROTECTED]] Sent: 22 November 2001 16:54 To: Struts-list (E-mail) Subject: design question Hello I have several questions about design, best practises: 1) Where to store client's profile information (like login name) ? session or system state bean ? Use the HttpSession. But be aware that you should put as little as possible into the session. Large sessions do not work well in a cluster. 2) How to create and use a system state bean ? System state bean should be in
Re: comments
Sobkowski, Andrej [EMAIL PROTECTED] wrote: Careful: !-- jsptag / -- The JSP tag will be evaluated (though not shown on the browser since the results will be commented out. And yes, they'll be visible by the client. %-- jsptag / --% The JSP is not evaluated and the commented part will not be sent to the resulting HTML page At least I think.. :) Andrej !-- jsptag / -- will be sent to the client. Whether it will be visible depends on what are you sending to the client. If plain text, then it will be visible. If HTML, it will become a HTML comment. Unless your jsptag / generates something like this --Hi!!-- ;-) -- gR -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Design question - Action Form vs Business Delegates/Value Objects
I'm interested in this mapper you talked about, thanks, btw: What is the difference between this one and the one on Ted Husted's? Are you talking about Mapco? Sandeep --- Sobkowski, Andrej [EMAIL PROTECTED] wrote: Hello, we're working on a quite large project with J2EE (including EJBs) and we're using Struts (we're still in the early phases). To design a clean application, I've defined different object conversions: * Request phase - the ActionForm is converted to a Value Object - the Value Object is passed to the EJBs * Response phase - the EJBs return one ore more Value Objects - the Value Object(s) is (are) converted back to ActionForms. I think it's a good approach, but: - my ActionForm and Value Objects have an almost identical interface. The main difference is that the ActionForm instance variables are always of type String while for the Value Object have final types information (Date, Integer, whatever) - the conversion ActionForm to VO and back is slowing down the performance as my EJBs often return hundreds of VOs (each one to be converted to an ActionForm). I know this can be improved by using paging (Page-by-Page iterator) on both the back-end and the front-end; furthermore, I've written a small mapper that uses extensively the Reflection API to automatically perform the mapping and this probably has an impact on the overall performance. My question is: what are the best practices for this type of issues? Does anybody have the same problems? Should I reduce the level of abstraction between the layers? Thank you! Andrej PS. if you're interested, I can share the simple mapper. It's a very small mapper (less than 15k) that works fine with my app. It's waaay less complete than the mapper on Ted Husted's site but... -Original Message- From: Jon.Ridgway [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 12:10 PM To: 'Struts Users Mailing List' Subject: RE: design question -Original Message- From: M`ris Orbid`ns [mailto:[EMAIL PROTECTED]] Sent: 22 November 2001 16:54 To: Struts-list (E-mail) Subject: design question Hello I have several questions about design, best practises: 1) Where to store client's profile information (like login name) ? session or system state bean ? Use the HttpSession. But be aware that you should put as little as possible into the session. Large sessions do not work well in a cluster. 2) How to create and use a system state bean ? System state bean should be in scope session, shouldnt it ? Again put as little as possible in the session and avoid statefull session beans. If you must put a bean in the session, make it as small as possible, ideally it would just hold key info that can be used to request beans at request level when needed. This is a trade off between performance and scalability. 3) Where to put business logic (where I invoke JDBC) ? Should business logic class be a bean ? If you have an app server business logic should go into a stateless session bean (BusinessService), which is invoked (via a BusinessDelegate) from a struts Action class. If you are not using EJBs then the Action class should still invoke a business delegate, but the delegate would simply create a normal Java bean to act as the Business Service. The business service (Stateless EJB or Java Bean) should delegate to another class to access a datasource. If your are using EJBs this should be a CMP or BMP+DAO depending on your app server (EJB 2 compliant consider CMP, else try CMP if supported but be prepared to subclass to a BMP+DAO at a later date). thanx in advance Maris Orbidans Jon Ridgway. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: displaying values in columns of 5
hi! just want to ask... how did you declare the variable i? coz i was not able to compile it. due to undefined variable i. thanx henrik -Original Message- From: Robert Parker [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 21, 2001 4:38 PM To: Struts Users Mailing List Subject: Re: displaying values in columns of 5 Here's what I did, I resorted to some script inside an iterate tag. You can access the iterator's internal counter as an Integer... (Note in this case I'm grouping by 3's) logic:iterate id=product name=element property=value indexId=i ... %=(((i.intValue()%3)==0) ((i.intValue() 0)))?BR/:% ... /logic:iterate regards Rob - Original Message - From: Henrick Chua [EMAIL PROTECTED] To: Struts Users Mailing List (E-mail) [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 11:19 AM Subject: displaying values in columns of 5 Hi folks! if i have a collection of values. let's say 23 items. how can i display it such a way that there are only 5 item in each row. should i use 2 iterates for it or something? thanx in advance h -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Design question - Action Form vs Business Delegates/Value Objects
Hi, I also agree with Michelle... I think what you are thinking is maybe you could use the struts form _as_ the value object? imho this would be bad design, as the whole idea of putting the logic in a separate tier is to have it not bound to any one form of presentation. What Michelle is suggesting though, is something like: public class EmployeeForm extends ActionForm { private EmployeeVO vo = new EmployeeVO(); public String getName() { return vo.getName(); } public void setName(String name) { vo.setName(name); } // and so on // get the vo public EmployeeVO getEmployeeVO() { return vo; } } so say you have an action class: public class AddEmployeeAction() { public void perform( ... ) { EmployeeForm eform = (EmployeeForm) form; employeeManager.add(eform.getEmployeeVO()); } } etc... very simplified example, but hopefully this is a bit clearer... I use this all the time, and would be interested to hear what other ppl think as well... cheers dim On Thu, 22 Nov 2001, Sobkowski, Andrej wrote: Michelle, thanks for your reply... but I'm not sure I understand your answer. Probably my message wasn't clear. To use an example, I have: EmployeeForm extends ActionForm +getName():String +getAge():String +getDateOfBirth():String EmployeeVO +getName():String +getAge():Integer +getDateOfBirth():Date EmployeeForm is a simple Struts mapping of the data displayed on the HTML page. EmployeeVO is the intermediate value/business object where the fields have a real meaning (a Date is a Date). I don't see the reasons of making EmployeeVO an instance variable of EmployeeForm. And EmployeeVO can not be used directly inside Struts to map data from an HttpRequest because (I think) that only Strings (and int?) can be handled in ActionForms. My question was somehow: should I get rid of EmployeeVO? It certainly makes the application cleaner but it may just be a picky thing that will simply waste resources. Thanks. Andrej -Original Message- From: Michelle Popovits [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 4:13 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Design question - Action Form vs Business Delegates/Value Objects Hi, I suggest to not duplicate variables that are in your Value Objects in your form object. Instead include the value object as a member of the the form object. ie. Form class - below the AccountVo is a value object within the form bean public class AddAccountForm extends ActionForm { public AccountVo getAccount() { return account; } public void setAccount(AccountVo aAccount) { account = aAccount; } } Then, in your jsp you reference the accountvo members like so using the dot notation -- the property account.password gets converted to getAccount().getPassword() or getAccount().setPassword(value). strutshtml:password property=account.password size=30 maxlength=10 / strutshtml:text property=account.accountName testexpr=eMail size=60 maxlength=100 / This feature of struts/javabeans is a real time saver in terms of development. Once something is in a value object then that value object gets passed from the back-end all the way to the front end without needing to touch any of it's attributes. And if you're editing the data on a web page when you submit the page the new data automatically gets set into the value object which can then be passed to the back end (no unnecessary handling of the data). HTH, Michelle From: Sobkowski, Andrej [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: Design question - Action Form vs Business Delegates/Value Objects Date: Thu, 22 Nov 2001 13:28:05 -0500 Hello, we're working on a quite large project with J2EE (including EJBs) and we're using Struts (we're still in the early phases). To design a clean application, I've defined different object conversions: * Request phase - the ActionForm is converted to a Value Object - the Value Object is passed to the EJBs * Response phase - the EJBs return one ore more Value Objects - the Value Object(s) is (are) converted back to ActionForms. I think it's a good approach, but: - my ActionForm and Value Objects have an almost identical interface. The main difference is that the ActionForm instance variables are always of type String while for the Value Object have final types information (Date, Integer, whatever) - the conversion ActionForm to VO and back is slowing down the performance as my EJBs often return hundreds of VOs (each one to be converted to an ActionForm). I know this can be improved by using paging (Page-by-Page iterator) on both the back-end and the front-end; furthermore, I've written a small mapper that uses extensively the Reflection API to automatically perform
Re: displaying values in columns of 5
Look at the iterate tag (see below) - the last attribute (indexId) is the iterator's counter variable. regards Rob - Original Message - From: Henrick Chua [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, November 23, 2001 9:33 AM Subject: RE: displaying values in columns of 5 hi! just want to ask... how did you declare the variable i? coz i was not able to compile it. due to undefined variable i. thanx henrik -Original Message- From: Robert Parker [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 21, 2001 4:38 PM To: Struts Users Mailing List Subject: Re: displaying values in columns of 5 Here's what I did, I resorted to some script inside an iterate tag. You can access the iterator's internal counter as an Integer... (Note in this case I'm grouping by 3's) logic:iterate id=product name=element property=value indexId=i ... %=(((i.intValue()%3)==0) ((i.intValue() 0)))?BR/:% ... /logic:iterate regards Rob - Original Message - From: Henrick Chua [EMAIL PROTECTED] To: Struts Users Mailing List (E-mail) [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 11:19 AM Subject: displaying values in columns of 5 Hi folks! if i have a collection of values. let's say 23 items. how can i display it such a way that there are only 5 item in each row. should i use 2 iterates for it or something? thanx in advance h -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: displaying values in columns of 5
i understand that the indexId=i is the counter... and it increments everytime it iterates... but the 'i' in %=(((i.intValue()%3)==0) ((i.intValue() 0)))?BR/:% is said to be undefined...? is this a bug of IBM websphere running apache tomcat? thanx. henrik -Original Message- From: Robert Parker [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 2:57 PM To: Struts Users Mailing List Subject: Re: displaying values in columns of 5 Look at the iterate tag (see below) - the last attribute (indexId) is the iterator's counter variable. regards Rob - Original Message - From: Henrick Chua [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, November 23, 2001 9:33 AM Subject: RE: displaying values in columns of 5 hi! just want to ask... how did you declare the variable i? coz i was not able to compile it. due to undefined variable i. thanx henrik -Original Message- From: Robert Parker [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 21, 2001 4:38 PM To: Struts Users Mailing List Subject: Re: displaying values in columns of 5 Here's what I did, I resorted to some script inside an iterate tag. You can access the iterator's internal counter as an Integer... (Note in this case I'm grouping by 3's) logic:iterate id=product name=element property=value indexId=i ... %=(((i.intValue()%3)==0) ((i.intValue() 0)))?BR/:% ... /logic:iterate regards Rob - Original Message - From: Henrick Chua [EMAIL PROTECTED] To: Struts Users Mailing List (E-mail) [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 11:19 AM Subject: displaying values in columns of 5 Hi folks! if i have a collection of values. let's say 23 items. how can i display it such a way that there are only 5 item in each row. should i use 2 iterates for it or something? thanx in advance h -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
How to remove/reset Request Parameters in action?? - is this possible??
Hi, Is it possible to clear request parameters. Either remove them, or at least reset them to another value? I'm trying to forward from one action to another, where the 2nd action's operations depends on request parameters. For the entry point I'm coming in from there need to be no request parameters, however there are still request parameters which the first action picked up (via it's associated form). I really want to just drop the request parameters (not attributes) in the first action before passing on to the 2nd action. That is my mapping for the first action is -: forward name=success path=/EventDisplay.do/ Thanks in advance Greg _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: displaying values in columns of 5
Works fine for me using Tomcat 3.x and 4.0 standalone. Maybe you could look at the generated jsp code to see what scope the variable is in... Rob - Original Message - From: Henrick Chua [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, November 23, 2001 9:56 AM Subject: RE: displaying values in columns of 5 i understand that the indexId=i is the counter... and it increments everytime it iterates... but the 'i' in %=(((i.intValue()%3)==0) ((i.intValue() 0)))?BR/:% is said to be undefined...? is this a bug of IBM websphere running apache tomcat? thanx. henrik -Original Message- From: Robert Parker [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 2:57 PM To: Struts Users Mailing List Subject: Re: displaying values in columns of 5 Look at the iterate tag (see below) - the last attribute (indexId) is the iterator's counter variable. regards Rob - Original Message - From: Henrick Chua [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, November 23, 2001 9:33 AM Subject: RE: displaying values in columns of 5 hi! just want to ask... how did you declare the variable i? coz i was not able to compile it. due to undefined variable i. thanx henrik -Original Message- From: Robert Parker [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 21, 2001 4:38 PM To: Struts Users Mailing List Subject: Re: displaying values in columns of 5 Here's what I did, I resorted to some script inside an iterate tag. You can access the iterator's internal counter as an Integer... (Note in this case I'm grouping by 3's) logic:iterate id=product name=element property=value indexId=i ... %=(((i.intValue()%3)==0) ((i.intValue() 0)))?BR/:% ... /logic:iterate regards Rob - Original Message - From: Henrick Chua [EMAIL PROTECTED] To: Struts Users Mailing List (E-mail) [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 11:19 AM Subject: displaying values in columns of 5 Hi folks! if i have a collection of values. let's say 23 items. how can i display it such a way that there are only 5 item in each row. should i use 2 iterates for it or something? thanx in advance h -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: All the jar files cann't be read
Hi Lily, I'm not sure which version of Tomcat you are using, but you need to read up a bit on webapps, because it seems that the JSP's are not being handled by Tomcat (perhaps Apache) or for some reason are being served as static files. Tomcat 4 has some good documentation on how to set up a web application: (should apply to 3 too). Sorry, can't send the link - jakarta.apache.org is down :( As for struts.jar, there is a doc on the struts site - probably in the FAQ or kickstart FAQ, about where struts.jar can and can't be. I think it pretty much says must be in web application's classpath - and nothing else. So you can't put it in the CLASSPATH variable, jre/ext/lib, or tomcat's common lib directory - that will make it available to Tomcat, other Java classes, and other webapps, which will make things break. Can I suggest you try getting the examples up and running first, then use them as a model for your own system? That's what I found easiest. Cheers, Brett -Original Message- From: Lily Zou [mailto:[EMAIL PROTECTED]] Sent: Friday, 23 November 2001 2:31 AM To: Struts Users Mailing List Subject: RE: All the jar files cann't be read I put the struts.jar file in that folder and put it into my classpath. Maybe that is the reason why it shows that path. May I ask where I could config this ? By the way, I still got blank page but if I click view source, I can see all the jsp code is there, which means that all the taglib or related lib files could not be found or linked. I think I put all the lib files in right place. May I ask where I could config this path other than at the top of each JSP page ? Tons of thanks. Lily -Original Message- From: Brett Porter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 21, 2001 6:04 PM To: 'Struts Users Mailing List' Subject: RE: All the jar files cann't be read That's a normal message in startup. However, the directory looks a bit suspect - there should be a WEB-INF/lib somewhere in there. eg here is mine: register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'jar:file:/home/bporter/cvs/shopping/product-db/tomcat/webapps/shopping/WEB- INF/lib/struts.jar!/org/apache/struts/resources/struts-config_1_0.dtd' for me, CATALINA_BASE = /home/bporter/cvs/shopping/product-db/tomcat -Original Message- From: Lily Zou [mailto:[EMAIL PROTECTED]] Sent: Thursday, 22 November 2001 9:24 AM To: Struts Users Mailing List Subject: RE: All the jar files cann't be read Thank you very much, Brett. The jar file did corrupted even though I just copied from somewhere else. This time I got: register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'jar:file:/C:/opt/redknee/product/s2100/1_0_1/lib/struts.jar!/org/apache/str uts/resources/struts-config_1_0.dtd' New org.apache.struts.action.ActionMapping May I ask why I got this ? Lily -Original Message- From: Brett Porter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 21, 2001 5:09 PM To: 'Struts Users Mailing List' Subject: RE: All the jar files cann't be read My guess is that it got corrupted in the download, or perhaps because you have two paths in the webapp name (s2100\si) - I've never seen that before, not sure if it should work. Can you unjar the struts.jar file manually into a temp dir to check it is not corrupt? - Brett -Original Message- From: Lily Zou [mailto:[EMAIL PROTECTED]] Sent: Thursday, 22 November 2001 9:06 AM To: 'Struts Users Mailing List' Subject: All the jar files cann't be read I put struts.jar and commons-*.jar file under WEB-INF\lib folder. However every time I started tomcat, I got following error msg ( every time it complains different jar file name ) and the page is just blank. Could anybody tell me what is the most likely reseason for this ? I am the first person in my company to try struts so I have no help around. Looking forward to any advice. cannot load servlet name: jsp: C:\opt\redknee\product\s2100\1_0_1\webapps\s2100\si\WEB-INF\lib\struts.jar is not a directory or zip/jar file or if it's a zip/ja r file then it is corrupted. register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'jar:file:/C:/opt/redknee/product/s2100/1_0_1/lib/struts.jar!/org/apache/str uts/resources/struts-config_1_0.dtd' resolveEntity('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd') Resolving to alternate DTD 'jar:file:/C:/opt/redknee/product/s2100/1_0_1/lib/struts.jar!/org/apache/str uts/resources/struts-config_1_0.dtd' New org.apache.struts.action.ActionMapping Set org.apache.struts.action.ActionMapping properties Call org.apache.struts.action.ActionServlet.addMapping(ActionMapping[path=/admin/ addFormBean, type=org.apache.struts.actions.AddFormBeanAction]) Pop org.apache.struts.action.ActionMapping
RE: All the jar files cann't be read
Hi, Brett Thank you very much for your great help. I am using Apache/tomcat3.2.1 and also I am trying to use our existing Ant system (quite complicated )to build it. Those configuration job is painful. I will try to use just Tomcat4.0 and get the example working, then move to Apache Tomcat. Thank you again, Brett. Lily -Original Message- From: Brett Porter [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 4:46 PM To: 'Struts Users Mailing List' Subject: RE: All the jar files cann't be read Hi Lily, I'm not sure which version of Tomcat you are using, but you need to read up a bit on webapps, because it seems that the JSP's are not being handled by Tomcat (perhaps Apache) or for some reason are being served as static files. Tomcat 4 has some good documentation on how to set up a web application: (should apply to 3 too). Sorry, can't send the link - jakarta.apache.org is down :( As for struts.jar, there is a doc on the struts site - probably in the FAQ or kickstart FAQ, about where struts.jar can and can't be. I think it pretty much says must be in web application's classpath - and nothing else. So you can't put it in the CLASSPATH variable, jre/ext/lib, or tomcat's common lib directory - that will make it available to Tomcat, other Java classes, and other webapps, which will make things break. Can I suggest you try getting the examples up and running first, then use them as a model for your own system? That's what I found easiest. Cheers, Brett -Original Message- From: Lily Zou [mailto:[EMAIL PROTECTED]] Sent: Friday, 23 November 2001 2:31 AM To: Struts Users Mailing List Subject: RE: All the jar files cann't be read I put the struts.jar file in that folder and put it into my classpath. Maybe that is the reason why it shows that path. May I ask where I could config this ? By the way, I still got blank page but if I click view source, I can see all the jsp code is there, which means that all the taglib or related lib files could not be found or linked. I think I put all the lib files in right place. May I ask where I could config this path other than at the top of each JSP page ? Tons of thanks. Lily -Original Message- From: Brett Porter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 21, 2001 6:04 PM To: 'Struts Users Mailing List' Subject: RE: All the jar files cann't be read That's a normal message in startup. However, the directory looks a bit suspect - there should be a WEB-INF/lib somewhere in there. eg here is mine: register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'jar:file:/home/bporter/cvs/shopping/product-db/tomcat/webapps/shopping/WEB- INF/lib/struts.jar!/org/apache/struts/resources/struts-config_1_0.dtd' for me, CATALINA_BASE = /home/bporter/cvs/shopping/product-db/tomcat -Original Message- From: Lily Zou [mailto:[EMAIL PROTECTED]] Sent: Thursday, 22 November 2001 9:24 AM To: Struts Users Mailing List Subject: RE: All the jar files cann't be read Thank you very much, Brett. The jar file did corrupted even though I just copied from somewhere else. This time I got: register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'jar:file:/C:/opt/redknee/product/s2100/1_0_1/lib/struts.jar!/org/apache/str uts/resources/struts-config_1_0.dtd' New org.apache.struts.action.ActionMapping May I ask why I got this ? Lily -Original Message- From: Brett Porter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 21, 2001 5:09 PM To: 'Struts Users Mailing List' Subject: RE: All the jar files cann't be read My guess is that it got corrupted in the download, or perhaps because you have two paths in the webapp name (s2100\si) - I've never seen that before, not sure if it should work. Can you unjar the struts.jar file manually into a temp dir to check it is not corrupt? - Brett -Original Message- From: Lily Zou [mailto:[EMAIL PROTECTED]] Sent: Thursday, 22 November 2001 9:06 AM To: 'Struts Users Mailing List' Subject: All the jar files cann't be read I put struts.jar and commons-*.jar file under WEB-INF\lib folder. However every time I started tomcat, I got following error msg ( every time it complains different jar file name ) and the page is just blank. Could anybody tell me what is the most likely reseason for this ? I am the first person in my company to try struts so I have no help around. Looking forward to any advice. cannot load servlet name: jsp: C:\opt\redknee\product\s2100\1_0_1\webapps\s2100\si\WEB-INF\lib\struts.jar is not a directory or zip/jar file or if it's a zip/ja r file then it is corrupted. register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'jar:file:/C:/opt/redknee/product/s2100/1_0_1/lib/struts.jar!/org/apache/str uts/resources/struts-config_1_0.dtd' resolveEntity('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN',
Re: Design question - Action Form vs Business Delegates/Value Objects
but doesn't struts require the setName()/getName() to be JavaBean compliant for populating the form with data before passing it to the action? or is there a way to tell struts to do differently? I agree the my way is much more typing :( cheers dim On Thu, 22 Nov 2001, Michelle Popovits wrote: Hi Dim, Your example is similar to my approach with the exception that you are still duplicating methods of the value object inside of the action form. Instead of including the individual accessors in the form, just include the accessor for the value object (see my original example)...much less unnecessary typing this way. When you need to access the value object properties in java you just cal the employeeForm.getEmployeeVo().getName() method and when you are in a jsp and want to bind the value object property to a text field you refer to the property as employeeVo.name. HTH, Michelle - Original Message - From: Dmitri Colebatch [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 5:34 PM Subject: RE: Design question - Action Form vs Business Delegates/Value Obj ects Hi, I also agree with Michelle... I think what you are thinking is maybe you could use the struts form _as_ the value object? imho this would be bad design, as the whole idea of putting the logic in a separate tier is to have it not bound to any one form of presentation. What Michelle is suggesting though, is something like: public class EmployeeForm extends ActionForm { private EmployeeVO vo = new EmployeeVO(); public String getName() { return vo.getName(); } public void setName(String name) { vo.setName(name); } // and so on // get the vo public EmployeeVO getEmployeeVO() { return vo; } } so say you have an action class: public class AddEmployeeAction() { public void perform( ... ) { EmployeeForm eform = (EmployeeForm) form; employeeManager.add(eform.getEmployeeVO()); } } etc... very simplified example, but hopefully this is a bit clearer... I use this all the time, and would be interested to hear what other ppl think as well... cheers dim On Thu, 22 Nov 2001, Sobkowski, Andrej wrote: Michelle, thanks for your reply... but I'm not sure I understand your answer. Probably my message wasn't clear. To use an example, I have: EmployeeForm extends ActionForm +getName():String +getAge():String +getDateOfBirth():String EmployeeVO +getName():String +getAge():Integer +getDateOfBirth():Date EmployeeForm is a simple Struts mapping of the data displayed on the HTML page. EmployeeVO is the intermediate value/business object where the fields have a real meaning (a Date is a Date). I don't see the reasons of making EmployeeVO an instance variable of EmployeeForm. And EmployeeVO can not be used directly inside Struts to map data from an HttpRequest because (I think) that only Strings (and int?) can be handled in ActionForms. My question was somehow: should I get rid of EmployeeVO? It certainly makes the application cleaner but it may just be a picky thing that will simply waste resources. Thanks. Andrej -Original Message- From: Michelle Popovits [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 4:13 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Design question - Action Form vs Business Delegates/Value Objects Hi, I suggest to not duplicate variables that are in your Value Objects in your form object. Instead include the value object as a member of the the form object. ie. Form class - below the AccountVo is a value object within the form bean public class AddAccountForm extends ActionForm { public AccountVo getAccount() { return account; } public void setAccount(AccountVo aAccount) { account = aAccount; } } Then, in your jsp you reference the accountvo members like so using the dot notation -- the property account.password gets converted to getAccount().getPassword() or getAccount().setPassword(value). strutshtml:password property=account.password size=30 maxlength=10 / strutshtml:text property=account.accountName testexpr=eMail size=60 maxlength=100 / This feature of struts/javabeans is a real time saver in terms of development. Once something is in a value object then that value object gets passed from the back-end all the way to the front end without needing to touch any of it's attributes. And if you're editing the data on a web page when you submit the page the new data automatically gets set into the value object which can then be passed to the back end (no unnecessary handling
Appender like DailyRollingFileAppend, .....
Hi, where do I find more about the use of the DailyRollingFileAppender? I tryed to use the RollingFileAppender and set the MaxFileSize for testpurpose to 1kb. It created a file about 2.5kb. What did go wrong? Does a Appender exists for example for EMail so its sends its messenges as an email? Is itpossible to use different categories with different appends at different log-level so for example category c1 uses appender a1 (FileAppender) if priority is error? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: design question
It is quite tricky to answer your question as you did not mention additional info i.e best practices is also depend on the application size ( how much client it will cater and for what purpose ) anyway this is what I hope you'll get something from my assumption :- 1) if the number of client is not too many i.e only have 100 + but no more than or never goes beyond 100 000 ( the number is abitrary , just to show you how big is big ) then session will be the choice since it is faster to retrieve the data , but if you 're going to have many clients then state bean will be more efficient since the session will used up your memory while the state bean ( session bean) will passivate if it is not used ( and save the memory ) 2) Please refer to the www.javasoft.com website and find the EJB tutorial from there 3) That depend on your architecture.basically the bean should stick to the javabeans specification design and should not have any jdbc calls ( but there is an exceptio for that . i.e if you create a bean for your taglibs you'll need to embed the jdbc to it ) -Original Message- From: Màris Orbidàns [SMTP:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 4:54 PM To: Struts-list (E-mail) Subject: design question Hello I have several questions about design, best practises: 1) Where to store client's profile information (like login name) ? session or system state bean ? 2) How to create and use a system state bean ? System state bean should be in scope session, shouldnt it ? 3) Where to put business logic (where I invoke JDBC) ? Should business logic class be a bean ? thanx in advance Maris Orbidans -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Design question - Action Form vs Business Delegates/Value Objects
Hello everyone, I also agree... We also use struts in J2EE apps with and make use of the Value Object pattern. (http://www.tstrata.trysoft.com) We assign the VO as a member of the ActionForm. If we want to abstract the VO, we add accessor methods to the Form as Dmitri has explained... these are all fairly well recognised design patterns. You definately DON'T want to pass struts concepts into your business layer (EJB's)! Maybe it's time for a sample application using struts and EJB's... based on JBoss perhaps... something that showcases EJB/Struts design patterns. Is there one already? Matt O'Haire Trysoft Corporation Ltd. http://www.trysoft.com -Original Message- From: Dmitri Colebatch [mailto:[EMAIL PROTECTED]] Sent: Friday, November 23, 2001 08:35 To: Struts Users Mailing List Cc: '[EMAIL PROTECTED]' Subject: RE: Design question - Action Form vs Business Delegates/Value Objects Hi, I also agree with Michelle... I think what you are thinking is maybe you could use the struts form _as_ the value object? imho this would be bad design, as the whole idea of putting the logic in a separate tier is to have it not bound to any one form of presentation. What Michelle is suggesting though, is something like: public class EmployeeForm extends ActionForm { private EmployeeVO vo = new EmployeeVO(); public String getName() { return vo.getName(); } public void setName(String name) { vo.setName(name); } // and so on // get the vo public EmployeeVO getEmployeeVO() { return vo; } } so say you have an action class: public class AddEmployeeAction() { public void perform( ... ) { EmployeeForm eform = (EmployeeForm) form; employeeManager.add(eform.getEmployeeVO()); } } etc... very simplified example, but hopefully this is a bit clearer... I use this all the time, and would be interested to hear what other ppl think as well... cheers dim
Re: Design question - Action Form vs Business Delegates/Value Obj ects
Hi Dim, Your example is similar to my approach with the exception that you are still duplicating methods of the value object inside of the action form. Instead of including the individual accessors in the form, just include the accessor for the value object (see my original example)...much less unnecessary typing this way. When you need to access the value object properties in java you just cal the employeeForm.getEmployeeVo().getName() method and when you are in a jsp and want to bind the value object property to a text field you refer to the property as employeeVo.name. HTH, Michelle - Original Message - From: Dmitri Colebatch [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 5:34 PM Subject: RE: Design question - Action Form vs Business Delegates/Value Obj ects Hi, I also agree with Michelle... I think what you are thinking is maybe you could use the struts form _as_ the value object? imho this would be bad design, as the whole idea of putting the logic in a separate tier is to have it not bound to any one form of presentation. What Michelle is suggesting though, is something like: public class EmployeeForm extends ActionForm { private EmployeeVO vo = new EmployeeVO(); public String getName() { return vo.getName(); } public void setName(String name) { vo.setName(name); } // and so on // get the vo public EmployeeVO getEmployeeVO() { return vo; } } so say you have an action class: public class AddEmployeeAction() { public void perform( ... ) { EmployeeForm eform = (EmployeeForm) form; employeeManager.add(eform.getEmployeeVO()); } } etc... very simplified example, but hopefully this is a bit clearer... I use this all the time, and would be interested to hear what other ppl think as well... cheers dim On Thu, 22 Nov 2001, Sobkowski, Andrej wrote: Michelle, thanks for your reply... but I'm not sure I understand your answer. Probably my message wasn't clear. To use an example, I have: EmployeeForm extends ActionForm +getName():String +getAge():String +getDateOfBirth():String EmployeeVO +getName():String +getAge():Integer +getDateOfBirth():Date EmployeeForm is a simple Struts mapping of the data displayed on the HTML page. EmployeeVO is the intermediate value/business object where the fields have a real meaning (a Date is a Date). I don't see the reasons of making EmployeeVO an instance variable of EmployeeForm. And EmployeeVO can not be used directly inside Struts to map data from an HttpRequest because (I think) that only Strings (and int?) can be handled in ActionForms. My question was somehow: should I get rid of EmployeeVO? It certainly makes the application cleaner but it may just be a picky thing that will simply waste resources. Thanks. Andrej -Original Message- From: Michelle Popovits [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 4:13 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Design question - Action Form vs Business Delegates/Value Objects Hi, I suggest to not duplicate variables that are in your Value Objects in your form object. Instead include the value object as a member of the the form object. ie. Form class - below the AccountVo is a value object within the form bean public class AddAccountForm extends ActionForm { public AccountVo getAccount() { return account; } public void setAccount(AccountVo aAccount) { account = aAccount; } } Then, in your jsp you reference the accountvo members like so using the dot notation -- the property account.password gets converted to getAccount().getPassword() or getAccount().setPassword(value). strutshtml:password property=account.password size=30 maxlength=10 / strutshtml:text property=account.accountName testexpr=eMail size=60 maxlength=100 / This feature of struts/javabeans is a real time saver in terms of development. Once something is in a value object then that value object gets passed from the back-end all the way to the front end without needing to touch any of it's attributes. And if you're editing the data on a web page when you submit the page the new data automatically gets set into the value object which can then be passed to the back end (no unnecessary handling of the data). HTH, Michelle From: Sobkowski, Andrej [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: Design question - Action Form vs Business Delegates/Value Objects Date: Thu, 22 Nov 2001 13:28:05 -0500 Hello, we're working on a quite large project with J2EE (including EJBs) and we're using Struts (we're still in the early phases). To design a clean
Re: query
Try, JSP1 - Action1 - JSP2 In Action1, you can use BeanUtil/PropertyUtil to copy the data from the bean from JSP1 to the bean used in JSP2. At 04:43 pm 01-12-2001 +0530, you wrote: Hello, Please help us identify a solution to the following requirement in STRUTS perspective: Passing form data from one .jsp to another without sharing a common bean. Regards Sai -- John Yu Scioworks Technologies e: [EMAIL PROTECTED] w: +(65) 873 5989 w: http://www.scioworks.com m: +(65) 9782 9610 Scioworks Camino - Rapid WebApp Assembly for Struts -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Design question - Action Form vs Business Delegates/Value Obj ects
Struts supports nested and indexed properties. Doing this, bean:write name=myEmployeeBean property=employeeVO.name/ Struts is clever enough to call myEmployeeBean.getEmployeeVO().getName(). See http://jakarta.apache.org/struts/api-1.0/org/apache/struts/taglib/bean/package-summary.html#doc.Properties and http://jakarta.apache.org/struts/api-1.0/org/apache/struts/util/PropertyUtils.html. At 11:25 am 23-11-2001 +1100, you wrote: but doesn't struts require the setName()/getName() to be JavaBean compliant for populating the form with data before passing it to the action? or is there a way to tell struts to do differently? I agree the my way is much more typing :( cheers dim On Thu, 22 Nov 2001, Michelle Popovits wrote: Hi Dim, Your example is similar to my approach with the exception that you are still duplicating methods of the value object inside of the action form. Instead of including the individual accessors in the form, just include the accessor for the value object (see my original example)...much less unnecessary typing this way. When you need to access the value object properties in java you just cal the employeeForm.getEmployeeVo().getName() method and when you are in a jsp and want to bind the value object property to a text field you refer to the property as employeeVo.name. HTH, Michelle - Original Message - From: Dmitri Colebatch [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 5:34 PM Subject: RE: Design question - Action Form vs Business Delegates/Value Obj ects Hi, I also agree with Michelle... I think what you are thinking is maybe you could use the struts form _as_ the value object? imho this would be bad design, as the whole idea of putting the logic in a separate tier is to have it not bound to any one form of presentation. What Michelle is suggesting though, is something like: public class EmployeeForm extends ActionForm { private EmployeeVO vo = new EmployeeVO(); public String getName() { return vo.getName(); } public void setName(String name) { vo.setName(name); } // and so on // get the vo public EmployeeVO getEmployeeVO() { return vo; } } so say you have an action class: public class AddEmployeeAction() { public void perform( ... ) { EmployeeForm eform = (EmployeeForm) form; employeeManager.add(eform.getEmployeeVO()); } } etc... very simplified example, but hopefully this is a bit clearer... I use this all the time, and would be interested to hear what other ppl think as well... cheers dim On Thu, 22 Nov 2001, Sobkowski, Andrej wrote: Michelle, thanks for your reply... but I'm not sure I understand your answer. Probably my message wasn't clear. To use an example, I have: EmployeeForm extends ActionForm +getName():String +getAge():String +getDateOfBirth():String EmployeeVO +getName():String +getAge():Integer +getDateOfBirth():Date EmployeeForm is a simple Struts mapping of the data displayed on the HTML page. EmployeeVO is the intermediate value/business object where the fields have a real meaning (a Date is a Date). I don't see the reasons of making EmployeeVO an instance variable of EmployeeForm. And EmployeeVO can not be used directly inside Struts to map data from an HttpRequest because (I think) that only Strings (and int?) can be handled in ActionForms. My question was somehow: should I get rid of EmployeeVO? It certainly makes the application cleaner but it may just be a picky thing that will simply waste resources. Thanks. Andrej -Original Message- From: Michelle Popovits [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 4:13 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Design question - Action Form vs Business Delegates/Value Objects Hi, I suggest to not duplicate variables that are in your Value Objects in your form object. Instead include the value object as a member of the the form object. ie. Form class - below the AccountVo is a value object within the form bean public class AddAccountForm extends ActionForm { public AccountVo getAccount() { return account; } public void setAccount(AccountVo aAccount) { account = aAccount; } } Then, in your jsp you reference the accountvo members like so using the dot notation -- the property account.password gets converted to getAccount().getPassword() or getAccount().setPassword(value). strutshtml:password
Re: maxlength
You can wrap the textarea inside a table. You may also want to take a look at: http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg01251.html At 06:33 pm 22-11-2001 +0530, you wrote: hi all we dont have any maxlength attribute for textArea in struts, can anyone tell me how to give a restriction on input characters on text area field thanks a lot in advance mahesh -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- John Yu Scioworks Technologies e: [EMAIL PROTECTED] w: +(65) 873 5989 w: http://www.scioworks.com m: +(65) 9782 9610 Scioworks Camino - Rapid WebApp Assembly for Struts -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Design question - Action Form vs Business Delegates/Value Objects
yes, thats fine _in the jsp_ my question is at the other end... for instance: 1. user completes form values and submits 2. struts actionservlet receives post and extracts parameters out of it 3. struts actionservlet maps the request to an action and instantiates the form for the action 4. struts actionservlet copies parameters from http post to the form this is where I am unsure of why your approach is able to work. I can see if you populate the form yourself then you will be able to call those methods yourself but how does step 4 take place if you dont tell struts that it needs to call form.getEmployeeVo()? The only place you have talked about doing that is in JSPs... for this to work, I would expect some configuration directive...? cheers dim On Thu, 22 Nov 2001, Michelle Popovits wrote: Hi Dim, Your example is similar to my approach with the exception that you are still duplicating methods of the value object inside of the action form. Instead of including the individual accessors in the form, just include the accessor for the value object (see my original example)...much less unnecessary typing this way. When you need to access the value object properties in java you just cal the employeeForm.getEmployeeVo().getName() method and when you are in a jsp and want to bind the value object property to a text field you refer to the property as employeeVo.name. HTH, Michelle - Original Message - From: Dmitri Colebatch [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 5:34 PM Subject: RE: Design question - Action Form vs Business Delegates/Value Obj ects Hi, I also agree with Michelle... I think what you are thinking is maybe you could use the struts form _as_ the value object? imho this would be bad design, as the whole idea of putting the logic in a separate tier is to have it not bound to any one form of presentation. What Michelle is suggesting though, is something like: public class EmployeeForm extends ActionForm { private EmployeeVO vo = new EmployeeVO(); public String getName() { return vo.getName(); } public void setName(String name) { vo.setName(name); } // and so on // get the vo public EmployeeVO getEmployeeVO() { return vo; } } so say you have an action class: public class AddEmployeeAction() { public void perform( ... ) { EmployeeForm eform = (EmployeeForm) form; employeeManager.add(eform.getEmployeeVO()); } } etc... very simplified example, but hopefully this is a bit clearer... I use this all the time, and would be interested to hear what other ppl think as well... cheers dim On Thu, 22 Nov 2001, Sobkowski, Andrej wrote: Michelle, thanks for your reply... but I'm not sure I understand your answer. Probably my message wasn't clear. To use an example, I have: EmployeeForm extends ActionForm +getName():String +getAge():String +getDateOfBirth():String EmployeeVO +getName():String +getAge():Integer +getDateOfBirth():Date EmployeeForm is a simple Struts mapping of the data displayed on the HTML page. EmployeeVO is the intermediate value/business object where the fields have a real meaning (a Date is a Date). I don't see the reasons of making EmployeeVO an instance variable of EmployeeForm. And EmployeeVO can not be used directly inside Struts to map data from an HttpRequest because (I think) that only Strings (and int?) can be handled in ActionForms. My question was somehow: should I get rid of EmployeeVO? It certainly makes the application cleaner but it may just be a picky thing that will simply waste resources. Thanks. Andrej -Original Message- From: Michelle Popovits [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 4:13 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Design question - Action Form vs Business Delegates/Value Objects Hi, I suggest to not duplicate variables that are in your Value Objects in your form object. Instead include the value object as a member of the the form object. ie. Form class - below the AccountVo is a value object within the form bean public class AddAccountForm extends ActionForm { public AccountVo getAccount() { return account; } public void setAccount(AccountVo aAccount) { account = aAccount; } } Then, in your jsp you reference the accountvo members like so using the dot notation -- the property account.password gets converted to getAccount().getPassword() or getAccount().setPassword(value). strutshtml:password property=account.password size=30 maxlength=10 / strutshtml:text
Re: Design question - Action Form vs Business Delegates/Value Objects
see my other email. I understand the jsp side of it, I want to know how the actionservlet deals with it. cheesr dim On Fri, 23 Nov 2001, John Yu wrote: Struts supports nested and indexed properties. Doing this, bean:write name=myEmployeeBean property=employeeVO.name/ Struts is clever enough to call myEmployeeBean.getEmployeeVO().getName(). See http://jakarta.apache.org/struts/api-1.0/org/apache/struts/taglib/bean/package-summary.html#doc.Properties and http://jakarta.apache.org/struts/api-1.0/org/apache/struts/util/PropertyUtils.html. At 11:25 am 23-11-2001 +1100, you wrote: but doesn't struts require the setName()/getName() to be JavaBean compliant for populating the form with data before passing it to the action? or is there a way to tell struts to do differently? I agree the my way is much more typing :( cheers dim On Thu, 22 Nov 2001, Michelle Popovits wrote: Hi Dim, Your example is similar to my approach with the exception that you are still duplicating methods of the value object inside of the action form. Instead of including the individual accessors in the form, just include the accessor for the value object (see my original example)...much less unnecessary typing this way. When you need to access the value object properties in java you just cal the employeeForm.getEmployeeVo().getName() method and when you are in a jsp and want to bind the value object property to a text field you refer to the property as employeeVo.name. HTH, Michelle - Original Message - From: Dmitri Colebatch [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 5:34 PM Subject: RE: Design question - Action Form vs Business Delegates/Value Obj ects Hi, I also agree with Michelle... I think what you are thinking is maybe you could use the struts form _as_ the value object? imho this would be bad design, as the whole idea of putting the logic in a separate tier is to have it not bound to any one form of presentation. What Michelle is suggesting though, is something like: public class EmployeeForm extends ActionForm { private EmployeeVO vo = new EmployeeVO(); public String getName() { return vo.getName(); } public void setName(String name) { vo.setName(name); } // and so on // get the vo public EmployeeVO getEmployeeVO() { return vo; } } so say you have an action class: public class AddEmployeeAction() { public void perform( ... ) { EmployeeForm eform = (EmployeeForm) form; employeeManager.add(eform.getEmployeeVO()); } } etc... very simplified example, but hopefully this is a bit clearer... I use this all the time, and would be interested to hear what other ppl think as well... cheers dim On Thu, 22 Nov 2001, Sobkowski, Andrej wrote: Michelle, thanks for your reply... but I'm not sure I understand your answer. Probably my message wasn't clear. To use an example, I have: EmployeeForm extends ActionForm +getName():String +getAge():String +getDateOfBirth():String EmployeeVO +getName():String +getAge():Integer +getDateOfBirth():Date EmployeeForm is a simple Struts mapping of the data displayed on the HTML page. EmployeeVO is the intermediate value/business object where the fields have a real meaning (a Date is a Date). I don't see the reasons of making EmployeeVO an instance variable of EmployeeForm. And EmployeeVO can not be used directly inside Struts to map data from an HttpRequest because (I think) that only Strings (and int?) can be handled in ActionForms. My question was somehow: should I get rid of EmployeeVO? It certainly makes the application cleaner but it may just be a picky thing that will simply waste resources. Thanks. Andrej -Original Message- From: Michelle Popovits [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 4:13 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Design question - Action Form vs Business Delegates/Value Objects Hi, I suggest to not duplicate variables that are in your Value Objects in your form object. Instead include the value object as a member of the the form object. ie. Form class - below the AccountVo is a value object within the form bean public class AddAccountForm extends ActionForm { public AccountVo getAccount() { return account; } public void