referring to the DTDs
I was wondering if there is a way for an xml doc to look for a dtd in 2 or 3 places. Can you do this: !DOCTYPE struts-configSYSTEM "file:///c:/bea/wlserver6.0/config/Wcom/applications/mydomain/WEB-INF/struts-config_1_0.dtd "file:///c:/dtds/struts-config_1_0.dtd "struts-config_1_0.dtd The reason is that I want to refer to the dtdusing a RELATIVE path on both UNIX and NT
Re: Strut and EJB/J2EE
Hi Chuong, I think struts is only a framework used to build presentation layer - Original Message - From: Chuong Huynh [EMAIL PROTECTED] To: Strut user List (E-mail) [EMAIL PROTECTED] Sent: Wednesday, July 25, 2001 10:09 AM Subject: Strut and EJB/J2EE Hi all, Sorry for naive question. I'm new to Struts - just construct some simple examples by myself... It seems to me that applications that use Struts are web-centric. I wonder where EJB comes into play? And is it easy to migrate Struts apps to J2EE applications...? Is Struts (alone) suitable for large scale applications, without being a J2EE app? Thanks, - Chuong = HUYNH, N. CHUONG TMA Software Solutions, Vietnam Tel: (84-8) 990 3848 - Ext: 5272 Email: [EMAIL PROTECTED] =
Debugging struts?
Hi. I'm thinking of trying to debug my struts stuff in Netbeans. Does anyone use this successfully, and do you know if it works with Tomcat 3.3 m2? Thanks, Dave
Indexed properties
Hi, What I want to do is to have multiple text fields in a table get assigned to an array or collection property in an ActionForm. I've followed a few threads in the newsgroups about this and have tried some jsp code: logic:iterate id=myObject name=indexedForm property=indexedPropsList TR TDhtml:text name=myObject property=name indexed=true//TD /TR /logic:iterate but this produces this jsp error: /pages/test/TestIndexedPropertyPage_Body.jsp(11): for tag 'text' handler type 'org.apache.struts.taglib.html.TextTag' has no property 'indexed' Is the indexed property a non-standard struts patch / extension I have to use? Thanks Nathan ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
Re: localization ugliness
[EMAIL PROTECTED] wrote: [...] What I'd like to do is something like: bean:message key=term.type%=bean.getType()%/ Of course, this doesn't work. So what I am actually doing is adding a new method to the bean which duplicates the code in bean:message so that the bean can do the mapping for me. I then display the string with: %= line.getTypeMessage(pageContext) % You can try this: bean:message key = '%= term.type + bean.getType() %' / or, better (does not work with struts 1.0 but with CVS 1.1) bean:message name=yourBean property=typeKey / if your bean is named yourBean and has a property String getTypeKey() { return term.type + getType(); } -- gR
RE: Re: localization ugliness
You can try this: bean:message key = '%= term.type + bean.getType() %' / At the moment, I'm restricted to v1.0 but the above is still much cleaner than what I had. Thanks! Devon
RE: what setters do i implement in an indexed tag ?
aliright - i'll check that out, anyone else reading this thread - there is a .zip file attached in the message: http://www.mail-archive.com/struts-user@jakarta.apache.org/msg12084.html Waz. =) -Original Message- From: Torsten Terp [mailto:[EMAIL PROTECTED]] Sent: 24 July 2001 17:57 To: [EMAIL PROTECTED] Subject: RE: what setters do i implement in an indexed tag ? Hi, You need 3 methods, a getter and a setter for the Vector (or other arraytype object) and a getter for single object in your arraytype object, i.e., getObject(int inx){ return myVector.elementAt(inx) } Just like on the webpage mentioned. the setters needed should be defined on the object your are returning in the getObject method. That is, what happens when the form fild data is passed to the form object is: getObject(inx).setProperty(someProperty). Dave Hay posted a very usefull example (source) in a post with subject: Re: Long Story short, posted on 2001.07.19!! You should check that out! ^terp -Original Message- From: Deadman, Hal [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 5:03 PM To: [EMAIL PROTECTED] Subject: RE: what setters do i implement in an indexed tag ? In the indexed tags write up at http://www.husted.com/about/struts/indexed-tags.htm, it only mentions the two types of get methods required in the action form. It doesn't mention the setters that are required. It looks like the getParameterList() method is only used by the iterate tag. To populate the form on submit the only setter needed is: public void setParameter(int index, Parameter p){...}; In your case that means: public void setParameter(int index, FieldMapping f) {...}; You probably don't need: public void setFieldMappings(java.util.Vector newFieldMappings) { fieldMappings = newFieldMappings; } unless you use it in your action to populate the form object before displaying the form jsp. I am about to try this myself so this is just a guess. Hal -Original Message- From: Warwick Boote [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 9:09 AM To: [EMAIL PROTECTED] Subject: what setters do i implement in an indexed tag ? I've created a page using indexed tags (neat stuff!). Here is what is currently working for me: o If i populate the form's vector, values from that vector are displayed in the jsp Here is what it not working: o when the form is posted back, the vector is null (in the struts perform() method) I suspect i haven't implemented some sort of setter within the form but i can't find an example as to what method should be implemented. I've tried ArrayList and using parameterList instead with no different result. Thanks, Waz. =) Here are some code snippits for help: ---jsp--- logic:iterate id=mappings name=FieldsMapForm property=fieldMappings html:text name=mappings property=attributeCode indexed=true/ br /logic:iterate ---Form--- public class FieldsMapForm extends ActionForm { private String fileColCount; private java.util.Vector fieldMappings = new java.util.Vector(); private String action; public String getFileColCount() { return fileColCount; } public void setFileColCount(String newFileColCount) { fileColCount = newFileColCount; } public void setFieldMappings(java.util.Vector newFieldMappings) { fieldMappings = newFieldMappings; } public java.util.Vector getFieldMappings() { return fieldMappings; } public FieldMapping getParameter(int index) { return (FieldMapping)fieldMappings.elementAt(index); } public void setAction(String newAction) { action = newAction; } public String getAction() { return action; } public void reset(ActionMapping mapping, HttpServletRequest request) { fileColCount = null; fieldMappings = new java.util.Vector(); action = null; } } ---The vector contains these:--- public class FieldMapping implements Serializable { private Integer fieldNumber; private String attributeCode; public void setFieldNumber(Integer newFieldNumber) { fieldNumber = newFieldNumber; } public Integer getFieldNumber() { return fieldNumber; } public void setAttributeCode(String newAttributeCode) { attributeCode = newAttributeCode; } public String getAttributeCode() { return attributeCode; } }
Re: Pre-Populating ActionForm (again)
if u have overridden validate method in the actionForm then ActionServlet automatically take u to the mapping.getInput() ( i.e ur input jsp file ) where u can show the errors using html:errors tag . Basicallly ActionErrors are kept in the request scope which are retrieved in the html:errors tag Else if u want to do validation even in ur action class , then create a instance of ActionErrors in the action class and add errors to it . save the errors using saveErrors(request , actionErrros) method available in the Struts- Action class . So errors will be kept in the request scope and again use same html:errors tag to display them For both editUser and save saveUser use same actionForm Suhas - Original Message - From: Aapo Laakkonen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 25, 2001 2:32 PM Subject: Pre-Populating ActionForm (again) I know that this have been asked several times, but I did not find answer for this little problem. I have list of lets say users. Each user has a link that maps to edituser action. That action then gets executed and it places userbean to request scope. Then struts forwards action to edituser.jsp. Edituser.jsp has form that has action mapping set to updateuser. When user submits that form which binds to userform action form the validate method of that actionform gets executed. If validation errors occurred then we get back to input form (which is edituser.jsp or edituser.do -- which to use?). And this is the point when I do not really understand what I should do, because when user gets back to edituser.jsp or edituser.do then there is not anymore that userbean is request scope. And because edituser.do does not have any forms associated with it then I should instead use edituser.jsp as input for updateuser action. But how I then write that form (jsp-page)? I have several options: 1. put userbean in session scope (might be problem in multiserver environment also the modifications that user entered are not visible). 2. Have another jsp-page that does not populate the form from userbean. Not good option because almost the same form needs to be written second time. 3. Use logic tags to check the existence of userbean and if it does not exist then do not populate and let the form populate itself from posted form. Same problems as in 2. 4. Somehow prepopulate the form with no manual population, but automatically. So do I pre-populate the form. What code I need to put in edituser action that previously placed userbean in request scope. I want to place the form object in that same scope, but don't know how. This is the best option and has no problems or at least I have not found a one. Thanks again! Aapo Laakkonen -- Aapo Laakkonen, +358 (50) 33 99 682, ProjectCast Ltd, Helsinki, Finland.
Re: Workflow impasse? and more
Hi All, Well I've finally got around to moving my struts subscriptions to a different address so I can setup rules etc to manage the number of mails on the lists! Moving them away from my work mail address is a good thing... So why am I telling you all this? Well I , like Craig T, signed up for several areas on the 1.1 Todo list a while back and like Craig have been busy with work and being away on holiday and training. So keeping up with the volume of mail has been difficult let alone contributing anything constructive. So I, like Craig, am going to have to cut down what I am involved in to make it fair to others and be able to contribute properly without spreading myself too thin. So I am going to back out of the following areas for the following reasons: Standard Validations Client Side Validations - because I have not done the work I expected to in this area and therefore feel I probably shouldn't buttin on these! EJB Design Patterns - for similar reasons. Although I have been working with EJBs I think there are others who are better qualified to lead this piece. I will of course contribute where possible to these areas but feel I am unable to lead them or take a direct role in designing/writing these. Which leaves the following: Multi-page form support - I think this really may tie in with the Workflow processing Workflow processing - I am working on workflow at the moment from a 'backend' perspective i.e. at the EJB layer which I hope will help cement my ideas for the Struts workflow. More on this later. Role-based Action Execution - I have been looking at JAAS and security in general and need to look into the specs a bit more to understand what _must_ be supported by containers and what _tends_ to be supported before we make a decision on exactly where to go withthis. Again more later. I hope this will enable to contribute more than I have in the past and get things moving. Apologies for anyone expecting me to take the others areas through to completion. So on to Workflow. As Ted suggests I also believe the fundamentals are there in the framework already. There have been several discussions about exactly what the workflow piece is but I think Ted's implications are the best. I don't think we are trying to design something that is a GUI nor are we trying to make something that conforms to standards which are in their infancy. This is not to say that support for products ( I think Visio for instance was suggested) should not come later but I think this is in addition to the underlying functionality which is to link Actions together to form a business process with pre- and post-requirements. This is where the thought on the multi-page forms comes in. I have been thinking about this a lot lately and have a few ways of doing this which when I cement them a little more will post here. I think we need to get down a solid set of requirements ( I think Ted's are a good start) and be clear what we are trying to achieve (I have tried to outline my view above) before we can proceed and I will take a proper look at the code examples Ted outlines in his mail. Much of the discussion so far has been on several tracks all under the global term 'workflow'. (Please don't take any of this as criticism - I am aware I haven't contributed much up until now - just observations and an attempt to get this going). So any comments on what we are trying to achieve and how? (and I am waiting for the slap too... ;) And then the security thing I have been primarily working with BEA Weblogic and working on a banking system so security has been key. We have had various discussions with BEA and finally got some answers so I have a clear idea of how BEA do things and how we may be able to fit this in to struts. What is currently not clear and Craig M has alluded to before is that the specs aren't really explicit in this area and each application server tends to do things in its own way. So I intend to look at the specs a little more to see what they should at least all support and then work on whether we want to link something into that or produce a struts specific implementation ( which obviously should abstract things so that people can plug in their app server specific stuff if necessary, although Struts is unlikely, at least at this stage, to support this 'out-of-the-box'.) As the saying goes...I'll be back... I hope I haven't stepped on anyone's toes here and I hope I can contribute properly in the future which I haven't been able to up until now due to other commitments. Could I ask someone who has commiter privs to remove me from the areas above on the todo list? Many thanks, Kind regards and keep up the good work! Nic Ted Husted
AW: Struts + JBoss
Hi. i've had trouble with jboss 2.2.2/tomcat 3.2.2...for this reason i dropped back to the 2.2.1/3.2.1 version and everything worked fine... Ok, I dropped back, too, now - but without success. Are you using Struts 1.0 or a newer version? in my experimentation, it seems to be a classloader issue...any classes you want to access from another class must be either on the same level, or higher in your classpath...if a .jar file that is located in the jboss/lib/ext directory is accessing a struts class or action class that is in your WEB-INF/lib/this.jar file, then it will give you this message... That's the way I am using the struts.jar now (in jboss/lib/ext). Does it work at you, when you use 2.2.1/3.2.1 ? Or do you have any suggestions where to put it otherwise... (I tried ear/war/WEB-INF/lib and the root of the .ear as Gregor suggested and many other locations - without any success). it's been a real pain :-) Jon Brisbin Lamar, MO Dominic Battré - Original Message - From: ecn11 [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 9:46 AM Subject: Struts + JBoss Hi. Has anyone of you managed to make Struts and JBoss working together? This is my current situation: I use JBoss-2.2.2 + Tomcat-3.2.2 (by run_with_tomcat.bat - so they are running in one VM) and Struts 1.0. The problem is briefly: When I deploy a .ear-archive that contains a .war-archive with the classes Struts should use (e.g. the form and action-classes), it throws an exception: javax.servlet.jsp.JspException: Exception creating bean of class path/DetailsForm: java.lang.ClassNotFoundException: path/DetailsForm at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:568) These are the lines of the Struts source-code where the exception is thrown: try { Class clazz = Class.forName(type); bean = clazz.newInstance(); if (bean instanceof ActionForm) ((ActionForm) bean).setServlet(servlet); } catch (Exception e) { throw new JspException (messages.getMessage(formTag.create, type, e.toString())); } The reason I blame Struts for that is the following: When I try to instanciate DetailsForm manually from the .jsp-page there is absolutely no problem. But Struts seems to use another classpath. Using the same .jsp-pages/classes/struts-config.xml/web.xml with Tomcat and J2EE-reference implementation works fine. - So I can say for sure that struts-config.xml and web.xml okay. This is the way the .ear-File looks like: .ear META-INF\ sun-j2ee-ri.xml, Manifest.mf, application.xml war-ic.war lots of stuff WEB-INF\ web.xml, struts-*.tld, struts-config.xml, global.properties classes\ Resources.properties all my classes ejb-jar-ic.jar the beans (they work fine) I once tried to add the .class-files manually to the classpath (not the ones that are created by jboss, when I deploy the .ear, but the .class-files, that I built before building the .ear-file). After that Struts was able to find the classes, but my classpath was completely messed up. The global.properties for example (which is accessible via InputStream is = getClass().getResourceAsStream(/global.properties) normally) was not found any more. Thanks in advance Dominic
Problem while running application in Struts
Hi, Whenever I run my applications (jsp pages) , I am getting the following exception. Thanks, Soniya. Error: 500 Location: /struts-i18n/test.jsp Internal Servlet Error: javax.servlet.ServletException java.lang.Throwable(java.lang.String) java.lang.Exception(java.lang.String) javax.servlet.ServletException(java.lang.Throwable) void org.apache.jasper.runtime.PageContextImpl.handlePageException(java.lang.Exception) void _0002ftest_0002ejsptest_jsp_0._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, boolean) void org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) void org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void org.apache.tomcat.core.ServletWrapper.doService(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response) void org.apache.tomcat.core.Handler.service(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response) void org.apache.tomcat.core.ServletWrapper.service(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response) void org.apache.tomcat.core.ContextManager.internalService(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response) void org.apache.tomcat.core.ContextManager.service(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response) void org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(org.apache.tomcat.service.TcpConnection, java.lang.Object []) void org.apache.tomcat.service.TcpWorkerThread.runIt(java.lang.Object []) void org.apache.tomcat.util.ThreadPool$ControlRunnable.run() void java.lang.Thread.run() Root cause: javax.servlet.jsp.JspException java.lang.Throwable(java.lang.String) java.lang.Exception(java.lang.String) javax.servlet.jsp.JspException(java.lang.String) int org.apache.struts.taglib.bean.MessageTag.doStartTag() void _0002ftest_0002ejsptest_jsp_0._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, boolean) void org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) void org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void org.apache.tomcat.core.ServletWrapper.doService(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response) void org.apache.tomcat.core.Handler.service(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response) void org.apache.tomcat.core.ServletWrapper.service(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response) void org.apache.tomcat.core.ContextManager.internalService(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response) void org.apache.tomcat.core.ContextManager.service(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response) void org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(org.apache.tomcat.service.TcpConnection, java.lang.Object []) void org.apache.tomcat.service.TcpWorkerThread.runIt(java.lang.Object []) void org.apache.tomcat.util.ThreadPool$ControlRunnable.run() void java.lang.Thread.run()
Re: Pre-Populating ActionForm (again)
if u have overridden validate method in the actionForm then ActionServlet automatically take u to the mapping.getInput() ( i.e ur input jsp file ) where u can show the errors using html:errors tag . Basicallly ActionErrors are kept in the request scope which are retrieved in the html:errors tag I know that. Else if u want to do validation even in ur action class , then create a instance of ActionErrors in the action class and add errors to it . save the errors using saveErrors(request , actionErrros) method available in the Struts- Action class . So errors will be kept in the request scope and again use same html:errors tag to display them I know this too... but it's not the problem what I'm having. Here is the work flow: 1. select user from list - executes SelectUserAction that places UserBean in request scope. - forwards to edituser.jsp. 2. Populate form that is in edituser.jsp from UserBean - that form has action mapping to UpdateUserAction. 3. Submit form (Update) - UserForm gets populated and then it's validated by struts by calling validate method. - If validation fails then go back to edituser.jsp and the problem arises: there is not anymore UserBean in request scope, because SelectUserAction is responsible of that and it does not get executed, so I get error: No xxx bean in scope null. So how do I write that form so I can populate it automatically? I mean that what code I should put in SelectUserAction so I can use tag like this: html:text property=userName size=14 maxlength=14/ to automatically pre-populate that form, instead of writing code like this: html:text name=userBean property=userName size=14 maxlength=14/. Is there some way to put pre-populated form in some scope so that struts automatically finds it and populates the form (I bet there is, but don't know how to do it). I also included my first mail in this so you can get more specific detail on this problem. I know that this have been asked several times, but I did not find answer for this little problem. I have list of lets say users. Each user has a link that maps to edituser action. That action then gets executed and it places userbean to request scope. Then struts forwards action to edituser.jsp. Edituser.jsp has form that has action mapping set to updateuser. When user submits that form which binds to userform action form the validate method of that actionform gets executed. If validation errors occurred then we get back to input form (which is edituser.jsp or edituser.do -- which to use?). And this is the point when I do not really understand what I should do, because when user gets back to edituser.jsp or edituser.do then there is not anymore that userbean is request scope. And because edituser.do does not have any forms associated with it then I should instead use edituser.jsp as input for updateuser action. But how I then write that form (jsp-page)? I have several options: 1. put userbean in session scope (might be problem in multiserver environment also the modifications that user entered are not visible). 2. Have another jsp-page that does not populate the form from userbean. Not good option because almost the same form needs to be written second time. 3. Use logic tags to check the existence of userbean and if it does not exist then do not populate and let the form populate itself from posted form. Same problems as in 2. 4. Somehow prepopulate the form with no manual population, but automatically. So do I pre-populate the form. What code I need to put in edituser action that previously placed userbean in request scope. I want to place the form object in that same scope, but don't know how. This is the best option and has no problems or at least I have not found a one. Thanks again! Aapo Laakkonen
AW: Struts + JBoss
Hi. Hi. Has anyone of you managed to make Struts and JBoss working together? This is my current situation: I use JBoss-2.2.2 + Tomcat-3.2.2 (by run_with_tomcat.bat - so they are running in one VM) and Struts 1.0. Hi, I use struts in jboss+tomcat. I use 2 configurations: 1st) Separate ejb and war. There are no problems, since I have no EAR file. Ok, I tried this but the result was the same... javax.servlet.jsp.JspException: Exception creating bean of class foo.bar.myclass: java.lang.ClassNotFoundException: foo.bar.myclass at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:568) I copied the .war-file into the jboss/deploy folder. After that my classes have been copied to jboss/tmp/deploy/Default/war-ic.war/web1004/WEB-INF/classes - but Struts doesn't find them anyway... -- gR Dominic Battré
Re: Struts + JBoss
ecn11 [EMAIL PROTECTED] wrote: Ok, I tried this but the result was the same... javax.servlet.jsp.JspException: Exception creating bean of class foo.bar.myclass: java.lang.ClassNotFoundException: foo.bar.myclass at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:568) I copied the .war-file into the jboss/deploy folder. After that my classes have been copied to jboss/tmp/deploy/Default/war-ic.war/web1004/WEB-INF/classes - but Struts doesn't find them anyway... Is your struts.jar in your war's WEB-INF/lib? And nowhere else in your classpath? -- gR
Cant compile my .java files to a class - is it a path issue --
Hi , I have been posting this problem for a while now - sorry. Albeit i was on a role until i modified my Action Class. Thus or hell broke loose. I had got to the stage whereby i had exstablished a connection to PostgreSQL v6( though posted a bug on PostgreSQL v7.1- same code don't work) and created a jsp submit form, an jsp extraction database form jsp select page . Nevertheless i have come to a ground halt due to my inquisitiveness . I have transfered my original classes files but on commencing again , hit the same hurdle. my path is C:\jarkarta-tomcat-3.2.2\webapps\bbnpa\WEB-INF\classes(package name)\.java file Thus do i have to implement a base dir above /WEB-INF/ -- example below -- /bbnpa/helloworld/WEB-INF/classes/helloworld/HelloWorldResources.prperties /bbnpa/helloworld/WEB-INF/classes/(package name)/.java file or As my path above without the base dir (helloworld) Note all my other jsp work with my current path set-up except i won't to utilise form beans instead of html/javascript pages so need to get this class issue sorted for the next level. Sorry 4 this long winded Q. Pls Help Cheers Chuck 8^{ -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
Cutom Tag request
html:label/ tag would be nice. What others think? Here is some uses: html:form action=someAction html:label property=someProperty/ /html:form html:form action=someAction html:label key=someKey/ /html:form It just prints string values like bean:write tag but does not require name attribute and cannot be used and associated with form. It also could have bean:message functionality. I know that this isn't a big issue, but sometimes you want to display something in form that is not editable (e.g. Primary Key). I know that I can use html:text readonly=true for most cases, but html:label tag could give you more flexibility.
Re: Cutom Tag request
It just prints string values like bean:write tag but does not require name attribute and cannot be used and associated with form. Of course I meant: It just prints string values like bean:write tag but does not require name attribute and can be used and associated with form.
Feature enhancement - triggering an Action
This thread appeared on the list earlier this week. QUESTION - JonathanCan someone tell me if there is a way to configure an action to match a pathregardless of how deep it is in a directory?ANSWER - TedNo. There is not a way to do this, without changing the way Struts isprogrammed to behave. You could request a feature change in Bugzilla, andbring it up on the DEV list for discussion.==As I was experimenting with our struts app I ran into the situation where Iwanted a generic "path-indifferent" name to trigger an action. Forinstance, in the following three cases:"/charts/display.do""/news/display.do"/events/outdoors/display.do"I didnt care about anything except the existence of "display.do" ANYWHEREat the end of ANY path. In fact, isnt this exactly how the servlet istriggered with ".do" This is what I expected, and the current Struts designwont let me do this. Do you all think this is an important feature? Ireally would like it as it can give a sense that the behaviour is common,and saves me time in thinking about how to properly trigger that particularaction I was wanting.
Missing type on declaration - any poniters
Hi, can someone take a peek at my ActionFoward Class - webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java [10:1] Missing type on declaration public perform(ActionMapping mapping, ^ webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java [35:1] Type expected or missing '}' ^ 2 errors Errors compiling ActionForward. - package classes.org.apache.struts.action; /*Accessing Relational Databases *Struts can define the datasources for an application from within its standard configuration file. A simple JDBC connection pool is also provided. *See The Action Mappings Configuration File section and the Utilities Developer Guide for details. *After the datasource is defined, here is an example of establishing a connection from within a Action perform method.*/ public class ActionForward { public perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ try { javax.sql.DataSource dataSource = servlet.findDataSource(null); java.sql.Connection myConnection = dataSource.getConnection(); //do what you wish with myConnection } catch (SQLException sqle) { getServlet().log(Connection.process, sqle); } finally { //enclose this in a finally block to make //sure the connection is closed try { myConnection.close(); } catch (SQLException e) { getServlet().log(Connection.close, e); } } } The path is C:/jakarta-tomcat-3.2.2/webapps/bbnpa/WEB-INF/classes/ do i need to creatE a base dir i.e C:/jakarta-tomcat-3.2.2/webapps/bbnpa/action/WEB-INF/classes/org/apache/struts/action/ActionForward Cheers Chuck -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
Re: Missing type on declaration - any poniters
perform method returns ActionForward - Original Message - From: Chuck Amadi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 25, 2001 5:11 PM Subject: Missing type on declaration - any poniters Hi, can someone take a peek at my ActionFoward Class -- --- webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java [10:1] Missing type on declaration public perform(ActionMapping mapping, ^ webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java [35:1] Type expected or missing '}' ^ 2 errors Errors compiling ActionForward. -- --- package classes.org.apache.struts.action; /*Accessing Relational Databases *Struts can define the datasources for an application from within its standard configuration file. A simple JDBC connection pool is also provided. *See The Action Mappings Configuration File section and the Utilities Developer Guide for details. *After the datasource is defined, here is an example of establishing a connection from within a Action perform method.*/ public class ActionForward { public perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ try { javax.sql.DataSource dataSource = servlet.findDataSource(null); java.sql.Connection myConnection = dataSource.getConnection(); file://do what you wish with myConnection } catch (SQLException sqle) { getServlet().log(Connection.process, sqle); } finally { file://enclose this in a finally block to make file://sure the connection is closed try { myConnection.close(); } catch (SQLException e) { getServlet().log(Connection.close, e); } } } The path is C:/jakarta-tomcat-3.2.2/webapps/bbnpa/WEB-INF/classes/ do i need to creatE a base dir i.e C:/jakarta-tomcat-3.2.2/webapps/bbnpa/action/WEB-INF/classes/org/apache/stru ts/action/ActionForward Cheers Chuck -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
Re: Missing type on declaration - any poniters 1 error left
Hi i have got it done to 1 error as below webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java [9:1] 'class' or 'interface' keyword expected. public ActionForward perform (ActionMapping mapping, ^ 1 error Errors compiling ActionForward. Chuck Amadi wrote: Hi, can someone take a peek at my ActionFoward Class - webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java [10:1] Missing type on declaration public perform(ActionMapping mapping, ^ webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java [35:1] Type expected or missing '}' ^ 2 errors Errors compiling ActionForward. - package classes.org.apache.struts.action; /*Accessing Relational Databases *Struts can define the datasources for an application from within its standard configuration file. A simple JDBC connection pool is also provided. *See The Action Mappings Configuration File section and the Utilities Developer Guide for details. *After the datasource is defined, here is an example of establishing a connection from within a Action perform method.*/ public class ActionForward { public perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ try { javax.sql.DataSource dataSource = servlet.findDataSource(null); java.sql.Connection myConnection = dataSource.getConnection(); //do what you wish with myConnection } catch (SQLException sqle) { getServlet().log(Connection.process, sqle); } finally { //enclose this in a finally block to make //sure the connection is closed try { myConnection.close(); } catch (SQLException e) { getServlet().log(Connection.close, e); } } } The path is C:/jakarta-tomcat-3.2.2/webapps/bbnpa/WEB-INF/classes/ do i need to creatE a base dir i.e C:/jakarta-tomcat-3.2.2/webapps/bbnpa/action/WEB-INF/classes/org/apache/struts/action/ActionForward Cheers Chuck -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
DataSource and Factories
Hi again, I would like to seperate my buisness logic from the data layer. Say I have an object Person, that has the fields id, firstName and lastName. The only constructor I provide is one which takes two arguments (id, firstName and lastName). The person objects will be stored in a certain Database, but this may change in the future, this is why I use a factory. The factory takes an id, connects to the DB, retrieves the data, creates the Person object and returns it. This pattern also comes in handy, when you have classes that inherit from Person. If the DB access would happen in the constructor, one could only create Person objects, with a factory, you can create an object of the real type instead. Anyway, what I want is to get a DataSource without knowing about a servlet. Is this somehow possible? Is there some static access to the DataSource Repository? Tia, Andreas
RE: Missing type on declaration - any poniters 1 error left
Hi i have got it done to 1 error as below webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java [9:1] 'class' or 'interface' keyword expected. public ActionForward perform (ActionMapping mapping, ^ 1 error Errors compiling ActionForward. Hi Chuck, this list is meant for struts-related topics. What you have here is a java-problem: I recommend one of the java-tutorial trails on java.sun.com. Mark 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 -
Re: DataSource and Factories
Hello Andreas, Wednesday, July 25, 2001, 1:59:50 PM, you wrote: AL Hi again, AL I would like to seperate my buisness logic from the data layer. Say I AL have an object Person, that has the fields id, firstName and lastName. AL The only constructor I provide is one which takes two arguments (id, AL firstName and lastName). The person objects will be stored in a certain AL Database, but this may change in the future, this is why I use a AL factory. The factory takes an id, connects to the DB, retrieves the AL data, creates the Person object and returns it. AL This pattern also comes in handy, when you have classes that inherit AL from Person. If the DB access would happen in the constructor, one could AL only create Person objects, with a factory, you can create an object of AL the real type instead. AL Anyway, what I want is to get a DataSource without knowing about a AL servlet. Is this somehow possible? Is there some static access to the AL DataSource Repository? Take a look to the Castor project - http://castor.exolab.org -- Best regards, Olegmailto:[EMAIL PROTECTED]
Re: DataSource and Factories
DataSource can be obtained either Deployment descriptor as java:comp/jdbc/MyDataSource (associate a Jndi name to the Datasource ) - Original Message - From: Andreas Leitner [EMAIL PROTECTED] To: [EMAIL PROTECTED]; 'Aapo Laakkonen' [EMAIL PROTECTED] Sent: Wednesday, July 25, 2001 3:29 PM Subject: DataSource and Factories Hi again, I would like to seperate my buisness logic from the data layer. Say I have an object Person, that has the fields id, firstName and lastName. The only constructor I provide is one which takes two arguments (id, firstName and lastName). The person objects will be stored in a certain Database, but this may change in the future, this is why I use a factory. The factory takes an id, connects to the DB, retrieves the data, creates the Person object and returns it. This pattern also comes in handy, when you have classes that inherit from Person. If the DB access would happen in the constructor, one could only create Person objects, with a factory, you can create an object of the real type instead. Anyway, what I want is to get a DataSource without knowing about a servlet. Is this somehow possible? Is there some static access to the DataSource Repository? Tia, Andreas
Re: Missing type on declaration - any poniters- perform Q
I have tried numerous variations public ActionForward perform ( public class ActionForward perfrom ( Please explain a bit more as my code is more or less the same as in the Building Controller Components - Action Classes.R ef Struts User Guide - Note i thought that the method perform will as it say's on the tin perform ActionMapping and ActionForm etc thus why they are not functionally.Thus what point am i missing. Cheers Chuck suhas wrote: perform method returns ActionForward - Original Message - From: Chuck Amadi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 25, 2001 5:11 PM Subject: Missing type on declaration - any poniters Hi, can someone take a peek at my ActionFoward Class -- --- webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java [10:1] Missing type on declaration public perform(ActionMapping mapping, ^ webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java [35:1] Type expected or missing '}' ^ 2 errors Errors compiling ActionForward. -- --- package classes.org.apache.struts.action; /*Accessing Relational Databases *Struts can define the datasources for an application from within its standard configuration file. A simple JDBC connection pool is also provided. *See The Action Mappings Configuration File section and the Utilities Developer Guide for details. *After the datasource is defined, here is an example of establishing a connection from within a Action perform method.*/ public class ActionForward { public perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ try { javax.sql.DataSource dataSource = servlet.findDataSource(null); java.sql.Connection myConnection = dataSource.getConnection(); file://do what you wish with myConnection } catch (SQLException sqle) { getServlet().log(Connection.process, sqle); } finally { file://enclose this in a finally block to make file://sure the connection is closed try { myConnection.close(); } catch (SQLException e) { getServlet().log(Connection.close, e); } } } The path is C:/jakarta-tomcat-3.2.2/webapps/bbnpa/WEB-INF/classes/ do i need to creatE a base dir i.e C:/jakarta-tomcat-3.2.2/webapps/bbnpa/action/WEB-INF/classes/org/apache/stru ts/action/ActionForward Cheers Chuck -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilwch bob copi. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
Re: Cutom Tag request
Aapo Laakkonen [EMAIL PROTECTED] wrote: html:label/ tag would be nice. What others think? Here is some uses: html:form action=someAction html:label property=someProperty/ /html:form html:form action=someAction html:label key=someKey/ /html:form It just prints string values like bean:write tag but does not require name attribute and cannot be used and associated with form. It also could have bean:message functionality. I know that this isn't a big issue, but sometimes you want to display something in form that is not editable (e.g. Primary Key). I know that I can use html:text readonly=true for most cases, but html:label tag could give you more flexibility. I'd like something like html:shown. It should work like html:hidden but it should also display the text. Sometimes I use html:hidden and bean:write together to display some property. When the user then submits the form (in request scope) and the validate() method refuses the input, there is no other way to get the data for the properties used in bean:write since no action is performed. So I use html:hidden to get the values along with user's input. -- gR
newbie: initial values
Hi. I apologize for this probably really stupid question, but I was not able to find a suitable answer anywhere, yet... In my user management I want to provide a way that the users can change their address (they are already stored in a database). Thus I need a form with the old address as initial values. In other words: There is a session variable UserId. How can the form bean that is used by edituser.jsp access this userid to adjust it's initial values. I can write name = peter; in the constructor of my EditUserForm class. But I want that the name is taken from a database depending on the UserId of the session. public void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) seems not to be executed. Is something like that the right way: public class EditUserForm extends ActionForm { protected boolean initialized = false; protected String name; String getName() { if ( !initialized ) doInitialize(); return name; } public void setName(String name) { this.name = name; } public void doInitialize() { name = get Name from Database... (but how can I access the sessionvariables here?) initialized = true; } } Is there a new instance of EditUserForm created each time a user accesses the page? Dominic
Multiple checkboxes, same name...
Hi all. Very new to this list and struts, but using it pretty successfully for a project at work. Good looking framework. Now the question: I have a form that will list anywhere from 0-9 vehicles. I have to allow multiple selection of vehicles. Currently I'm using html:select multiple=true... type tags, but would like to use checkboxes, so would the following work? Create a bean with name/value pairs for each vehicle and do a logic:iterate... tag and generate an html:multibox... for each entry (the selected vehicles are an array in a form bean). The above sounds pretty reasonable, but I'm unsure how to get it to work. Specifically, how to get the proper value= attribute in the multibox tag: !-- vehicles is a page-scope hashtable -- logic:iterate id=entry name=vehicles ** how to get the key property of 'entry' into value attrib? ** html:multibox property=principalOperators value=??? bean:write name=entry property=value/ /html:multibox /logic:iterate Thanks in advance, Carmine Lucarelli
Re: newbie: initial values
ecn11 [EMAIL PROTECTED] writes: Hi. I apologize for this probably really stupid question, but I was not able to find a suitable answer anywhere, yet... In my user management I want to provide a way that the users can change their address (they are already stored in a database). Thus I need a form with the old address as initial values. In other words: There is a session variable UserId. How can the form bean that is used by edituser.jsp access this userid to adjust it's initial values. Dont do it this way. Implement an Action which fills the form with values. What I usually (I use struts one month :-) do in such edit something situations: I create I an EditTgingActionForm with properties a) the key properties b) the dependent properties c) optional - a boolean indicator isEditing I create an EditThingAction which: d) checks to see, whether the form has been filled from HTTP (which means: b) properties are filled and c) is true) if so, then it performs the updates. If not, no updates. e) fills the properties b) from the database using the key properties a). In my JSP which leads to that action, i use parametrized link: a href=editthing.do?id=BLA (generated with html:link) As you see, properties b) or c) are not supplied, so the Action knows, there is nothing to be updated, it just retrieves the data. editthing.do then forward to a JSP, which displays the retrieved data and when submitted (again to editthing.do) EditThingAction know, it has to update the data. -- gR
Re: Refresh button and Back button
The back button problem is standard. You need to use a token to prevent sensitive form resubmission. This is documented in Geary's Advanced JSP book and Core J2EEE patterns. They are both put out by Sun. In short, tokens allow you to determine whether the page should be processed in the normal way. You include a token in the request and save a copy in the session. When the page is submitted, you check that they match. If so, you can do normal processing. If not, you need to decide what to do. Struts supports tokens, but the implementation is opaque (IMHO). Geary's book provides a good treatment. However, there is an error in the code he uses to check tokens (don't have book in front right now, so can't spell it out). I think he does not check all the cases he says he does. At any rate, the code is in the book for the test tokens tag he develops. Even if you used the Struts implementation, you would have to use his logic. Bud -- ___ Bud Gibson e-Lab Czar Assistant Professor University of Michigan Business School 701 Tappan Street, C2424 Ann Arbor, MI 48109-1234 ph: 734\647-9200 fax: 734\764-3240 [EMAIL PROTECTED]
ActionForward.java [11:1] 'class' or 'interface' keyword expected.
Hi again i have one error but this is the example from 2.6 Accessing Relational Databases found within the struts - documentation. Any Pointers as i assumed that Action.class was the interface/abstract class and thus i am totally confused. ActionFoward at the below address. file:///C|/jakarta-tomcat-3.2.2/webapps/struts-documentation/userGuide/building_model.html --- WEB-INF/classes/org/apache/struts/action/ActionForward.java [11:1] 'class' or 'interface' keyword expected. public ActionForward ^ 1 error Errors compiling ActionForward. -- package classes.org.apache.struts.action; /*Accessing Relational Databases *Struts can define the datasources for an application from within its standard configuration file. A simple JDBC connection pool is also provided. *See The Action Mappings Configuration File section and the Utilities Developer Guide for details. *After the datasource is defined, here is an example of establishing a connection from within a Action perform method.*/ public ActionForward -// public ActionForward (class/interface) ?? perform (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ try { javax.sql.DataSource dataSource = servlet.findDataSource(null); java.sql.Connection myConnection = dataSource.getConnection(); //do what you wish with myConnection } catch (SQLException sqle) { getServlet().log(Connection.process, sqle); } finally { //enclose this in a finally block to make //sure the connection is closed try { myConnection.close(); } catch (SQLException e) { getServlet().log(Connection.close, e); } } } Cheers Chuckie -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
RE: Multiple checkboxes, same name...
Hi all. Very new to this list and struts, but using it pretty successfully for a project at work. Good looking framework. Now the question: [snip] The above sounds pretty reasonable, but I'm unsure how to get it to work. Specifically, how to get the proper value= attribute in the multibox tag: !-- vehicles is a page-scope hashtable -- logic:iterate id=entry name=vehicles ** how to get the key property of 'entry' into value attrib? ** html:multibox property=principalOperators value=??? bean:write name=entry property=value/ /html:multibox /logic:iterate Hello Carmine, you've almost answered your own question: if you want the value to be calculated during the iteration, leave the value parameter off! In this case struts will use the body of the html:multibox tag as the value. So: logic:iterate id=entry name=vehicles html:multibox property=principalOperators bean:write name=entry property=value/ /html:multibox /logic:iterate does what you want. Cheers, Mark 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 -
Accessing JDBC-ODBC from Struts
Hi I need some direction on how to incorporate JDBC-ODBC into my struts and where the ODBC should be stored in my application. Also how to reference that in my Action Servlet, I am a little unsure about this area, but would appreciate some feed back or documentation that will simplify my work. Thanks Rodney -- Sent through GMX FreeMail - http://www.gmx.net
Re: ActionForward.java [11:1] 'class' or 'interface' keyword expected.
ActionForward is class - public class ActionForward Suhas - Original Message - From: Chuck Amadi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 25, 2001 6:29 PM Subject: ActionForward.java [11:1] 'class' or 'interface' keyword expected. Hi again i have one error but this is the example from 2.6 Accessing Relational Databases found within the struts - documentation. Any Pointers as i assumed that Action.class was the interface/abstract class and thus i am totally confused. ActionFoward at the below address. file:///C|/jakarta-tomcat-3.2.2/webapps/struts-documentation/userGuide/build ing_model.html -- - WEB-INF/classes/org/apache/struts/action/ActionForward.java [11:1] 'class' or 'interface' keyword expected. public ActionForward ^ 1 error Errors compiling ActionForward. -- package classes.org.apache.struts.action; /*Accessing Relational Databases *Struts can define the datasources for an application from within its standard configuration file. A simple JDBC connection pool is also provided. *See The Action Mappings Configuration File section and the Utilities Developer Guide for details. *After the datasource is defined, here is an example of establishing a connection from within a Action perform method.*/ public ActionForward -// public ActionForward (class/interface) ?? perform (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ try { javax.sql.DataSource dataSource = servlet.findDataSource(null); java.sql.Connection myConnection = dataSource.getConnection(); file://do what you wish with myConnection } catch (SQLException sqle) { getServlet().log(Connection.process, sqle); } finally { file://enclose this in a finally block to make file://sure the connection is closed try { myConnection.close(); } catch (SQLException e) { getServlet().log(Connection.close, e); } } } Cheers Chuckie -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
RE: problems mapping multiple ActionServlets
Adam, I deployed my war file on Weblogic and got the same result as on Tomcat, mapping was changed unexpectedly. -Original Message- From: Adam Young [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 8:20 PM To: [EMAIL PROTECTED] Subject: Re: problems mapping multiple ActionServlets I'm working with Dave. Seems like it is a Tomcat problem. I turned on debugging, and it looks like both entries for the extension mappings are calling both servlet mapppings. Adam Dave Allen wrote: Thanks for your response. I think we'll just have to do some sort of security validation in the Action. Dave On Mon, 23 Jul 2001 15:22:52 -0400 Zeltser, Mark [EMAIL PROTECTED] wrote: Dave, I had the similar problem (see my posting today). I had 2 mappings in web.xml and 2 servlets which extended ActionServlet. Somehow, after I access second servlet my *.do mapping was changed with url-path of second servlet. Don't extend ActionServlet more than once - it will screw up your mapping. Mark. -Original Message- From: Dave Allen [SMTP:310 [EMAIL PROTECTED]] Sent: Monday, July 23, 2001 3:12 PM To:[EMAIL PROTECTED] Subject: problems mapping multiple ActionServlets This might be more appropriate for the Tomcat user list, but I'll try anyway. I'm using Tomcat 3.2.2 and trying to map multiple ActionServlets in web.xml. I have a servlet-mapping for *.do which I execute for the form action search.do, and everything works fine when this is the only servlet-mapping in web.xml. But as soon as I add another servlet-mapping for *.authDo, when I try to execute search.do, search.authDo is called (it even appears in the URL), which I don't understand since I don't call search.authDo from anywhere in my page (or anywhere on the site). If I the change to added mapping to any name, like *.anything, search.anything is called . The pertinent code is below. Many advanced thanks. Dave From the jsp: form:form action=search.do name=caretoolSearchForm type=com.getcare.servlet.CaretoolSearchForm From web.xml: servlet servlet-nameAction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameapplication/param-name param-valuecom.getcare.servlet.ErrorMessages/param-value /init-param init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-namevalidate/param-name param-valuetrue/param-value /init-param load-on-startup1/load-on-startup /servlet servlet servlet-nameauthAction/servlet-name servlet-classcom.getcare.servlet.CaretoolActionServlet/servlet-class init-param param-nameapplication/param-name param-valuecom.getcare.servlet.ErrorMessages/param-value /init-param init-param param-nameconfig/param-name param-value/WEB-INF/struts-auth-config.xml/param-value /init-param init-param param-namevalidate/param-name param-valuetrue/param-value /init-param load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameAction/servlet-name url-pattern*.do/url-pattern /servlet-mapping servlet-mapping servlet-nameauthAction/servlet-name url-pattern*.authDo/url-pattern /servlet-mapping - - This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - - This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination,
RE: accessing user-defined classes from html:select and html:options tags
I added the import statement, but still get the same error. It's in a Struts method called BeanUtils.populate. I have the imported class in my .WAR file, and I even tried placing it directly in the server class path, but still the same error. Any ideas? Below is the full error text. Thanks for the help, Philip Internal Servlet Error: javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:774) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:20 61) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1563) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) 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(ContextManager.java:79 7) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC onnectionHandler.java:213) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) at java.lang.Thread.run(Thread.java:484) Root cause: java.lang.IllegalArgumentException: argument type mismatch at java.lang.reflect.Method.invoke(Native Method) at org.apache.struts.util.PropertyUtils.setSimpleProperty(PropertyUtils.java:98 8) at org.apache.struts.util.PropertyUtils.setNestedProperty(PropertyUtils.java:90 4) at org.apache.struts.util.PropertyUtils.setProperty(PropertyUtils.java:932) at org.apache.struts.util.BeanUtils.populate(BeanUtils.java:509) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:772) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:20 61) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1563) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) 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(ContextManager.java:79 7) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC onnectionHandler.java:213) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) at java.lang.Thread.run(Thread.java:484) -Original Message- From: eden [mailto:[EMAIL PROTECTED]] Sent: Monday, July 23, 2001 7:23 PM To: [EMAIL PROTECTED] Subject: RE: accessing user-defined classes from html:select and html:options tags Hi! I know you asked this question last Friday, but I didn't see a response to it in the last several days. So, in case you're still wondering, yes - you've got to import that class into the jsp page in order for it to be used in the page context. And don't forget that it needs to be in your web server's classpath! Hope this helps, Melissa Web Developer -Original Message- From: Philip Tucker [mailto:[EMAIL PROTECTED]] Sent: Friday, July 20, 2001 9:39 PM To: '[EMAIL PROTECTED]' Cc: Jyotisana Verma Subject: accessing user-defined classes from html:select and html:options tags I'm using Struts 1.0 with Tomcat 3.2.2 and JBoss 2.2.2. I'm using an hrml:select containing an html:options tag in a JSP, with the property attributes referring to form and bean fields. It works fine when the Java class of the 2 bean properties is String, but when I try to use class I created I get an error. I've verified my .class file is in the deployment WAR file. Do I have to do something special to use my own class? Do I need an import statement in the JSP? Thanks, Philip
Re: ActionForward.java [11:1] 'class' or 'interface' keyword expected.
Hi , again i have been told that these type of queries/problems should be directed at java-user group. Thus i shall subscribe i only know the basic fundamentals to java thus i find it misleading when one who has a problem trying to construct a web development project that contains Controller components that struts includes promotes with it's servlets that implements the Action.class that this is the wrong group as the Building Controller Components is fundamental to MVC. So apologize for posting so many queries but this user group did get up and running . So i'll be back with only struts queries cheers all. suhas wrote: ActionForward is class - public class ActionForward Suhas - Original Message - From: Chuck Amadi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 25, 2001 6:29 PM Subject: ActionForward.java [11:1] 'class' or 'interface' keyword expected. Hi again i have one error but this is the example from 2.6 Accessing Relational Databases found within the struts - documentation. Any Pointers as i assumed that Action.class was the interface/abstract class and thus i am totally confused. ActionFoward at the below address. file:///C|/jakarta-tomcat-3.2.2/webapps/struts-documentation/userGuide/build ing_model.html -- - WEB-INF/classes/org/apache/struts/action/ActionForward.java [11:1] 'class' or 'interface' keyword expected. public ActionForward ^ 1 error Errors compiling ActionForward. -- package classes.org.apache.struts.action; /*Accessing Relational Databases *Struts can define the datasources for an application from within its standard configuration file. A simple JDBC connection pool is also provided. *See The Action Mappings Configuration File section and the Utilities Developer Guide for details. *After the datasource is defined, here is an example of establishing a connection from within a Action perform method.*/ public ActionForward -// public ActionForward (class/interface) ?? perform (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ try { javax.sql.DataSource dataSource = servlet.findDataSource(null); java.sql.Connection myConnection = dataSource.getConnection(); file://do what you wish with myConnection } catch (SQLException sqle) { getServlet().log(Connection.process, sqle); } finally { file://enclose this in a finally block to make file://sure the connection is closed try { myConnection.close(); } catch (SQLException e) { getServlet().log(Connection.close, e); } } } Cheers Chuckie -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilwch bob copi. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
RE: Accessing JDBC-ODBC from Struts
in the struts-config.xml there is configuration for datasources which you can use... u dont have to do anything in the action servlet... in the action class u get the connection to the object... -Original Message- From: Rodney Smith [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 2:20 PM To: [EMAIL PROTECTED] Subject: Accessing JDBC-ODBC from Struts Hi I need some direction on how to incorporate JDBC-ODBC into my struts and where the ODBC should be stored in my application. Also how to reference that in my Action Servlet, I am a little unsure about this area, but would appreciate some feed back or documentation that will simplify my work. Thanks Rodney -- Sent through GMX FreeMail - http://www.gmx.net -- The information in this Internet email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this Internet email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this Internet email are subject to the terms and conditions expressed in any applicable governing ING Barings' terms of business or client engagement letter. Visit us at www.ingbarings.com --
Newbie installation question
Title: Newbie installation question Hi there, I am running Tomcat 4.0 b5. After placing the struts war files into the webapps directory, restarting tomcat, and confirming the directories had been built out, I went to struts-example and received the following stack trace: Looks to me like struts can't find some needed components... What am I missing? Thanks, -Jonathan Exception Report: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:442) at org.apache.jsp.index_jsp._jspService(index_jsp.java:454) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:200) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:875) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952) at java.lang.Thread.run(Thread.java:484) Root Cause: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.struts.util.RequestUtils.message(RequestUtils.java:568) at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239) at org.apache.jsp.index_jsp._jspService(index_jsp.java:94) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:200) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at
Re: Accessing JDBC-ODBC from Struts
Hello Rodney, Wednesday, July 25, 2001, 5:19:58 PM, you wrote: RS Hi RS I need some direction on how to incorporate JDBC-ODBC into my struts RS and where the ODBC should be stored in my application. Also how to reference RS that in my Action Servlet, I am a little unsure about this area, but would RS appreciate some feed back or documentation that will simplify my work. No problem. Open connection with ODBC-JDBC driver in Action class and perform any operations with this datasource. -- Best regards, Olegmailto:[EMAIL PROTECTED]
RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope!
Pardon my skepticism, but from all appearances, the WAS 4.0 GA release is out (nothing on the IBM WebSphere site says that the 4.0 you can now download is beta), and this particular issue is *not* resolved. The antiquated version of Jasper is still included. And from the response to my question about this on this list a month ago or so, just dropping in a new Jasper is not something that's likely to happen quickly. If this issue was just brought to their attention a couple of weeks ago (meaning that they didn't know about it), I wouldn't hold my breath on a quick resolution. I'd love to see the fix appear in a fixpack (and soon) but we tried out 4.0 as soon as it was released the end of June, primarily to see if this issue was resolved, and were disappointed. John -Original Message- From: Pravin George [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 9:26 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope! Hi everyone, I wanted to clarify the status of Struts and Websphere 4 compatability. As a business partner to IBM, we are on the beta testing program for Websphere 4.0 . This particular issue was brought to their attention a couple of weeks ago. Last week we received word that it has been fixed in the latest beta build and will not be an issue in the final GA release. Pravin George, Software Engineer, eBuilt Inc. , Irvine, CA 92614. RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope! Date: Tue, 24 Jul 2001 13:16:48 -0700 From: Calabrese, Jason [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] I'm running struts on Websphere 3.5.4 and had similar problems. This is the response I got. Check this out.. http://www.mail-archive.com/struts-user@jakarta.apache.org/msg10964.html And.. Sure thing - I already sent it but the list refused it due to its file size. As an alternative, I'll put it up on my personal FTP space and anyone who wants it can download it from there! :) Struts.jar with Form tag modifications: http://www.enfused.com/struts.jar -Original Message- From: Mark Wilson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 1:07 PM To: '[EMAIL PROTECTED]' Subject: Struts on IBM WAS 4.0 - Error removing attributes from request sc ope! Hello, thanks for you're attention. I am deploying the struts-example app on IBM Websphere App Server 4.0 and receive an IllegalArgumentException - Can't remove attribute from request scope. the situation: I have drilled into the problem and discovered that IBM is using a significantly different implementation of the class, org.apache.jasper.runtime.PageContextImpl. Their class alters the logic of removing attributes using the methods removeAttribute(String s, int i) and removeAttribute(String s). I have included the code in the next section of the e-mail. In summary, using WAS 4.0, attributes are not removed from request scope. This conflicts most directly with the struts framework class, org.apache.struts.taglib.html.FormTag. FormTag calls pageContext.removeAttribute(Constants.BEAN_KEY, PageContext.REQUEST_SCOPE) and pageContext.removeAttribute(Constants.FORM_KEY, PageContext.REQUEST_SCOPE) within the doEndTag() method. Either of these method calls will generate an IllegalArgumentException on WAS 4.0. the code (more or less): org.apache.jasper.runtime.PageContextImpl (note: not the same code as used in tomcat's implementation...) public void removeAttribute(String s, int i) { switch (i) { case PAGE_SCOPE: pageScopeAttributes.remove(s); break; case REQUEST_SCOPE: throw new IllegalArgumentException(Can't remove Attributes from request scope); case SESSION_SCOPE: if (session == null) throw new IllegalArgumentException(Can't access SESSION_SCOPE without an HttpSession); theSession.removeAttribute(s); break; case APPLICATION_SCOPE: theContext.removeAttribute(s); break; } } // and ... public void removeAttribute(String s) { pageScopeAttributes.remove(s); } // (pageScopeAttributes is a Hashtable of objects stored at Page scope only!) a partial solution: Replacing the removeAttribute(String s, int i) method calls with removeAttribute(String s) within the struts class, FormTag.doEndTag() relieves the exception, but on WAS 4.0, it will not remove the attribute! (in fact, only attributes found in page scope will be removed when the method, removeAttribute(String s) is called.) testing results: Even though the
Re: Accessing JDBC-ODBC from Struts
One of the - more complicated - solutions is to set up Java Naming and Directory services (JNDI, see the documentation that comes with JDK1.3). Using JNDI you can hide the details of connecting to your database(s) in a DataSource object you store in the naming service. Sun provides us with a com.sun.jndi.fscontext.RefFSContextFactory class that provides a filesystem naming service. Regards, Guus - Original Message - From: Rodney Smith [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 25, 2001 15:19 Subject: Accessing JDBC-ODBC from Struts Hi I need some direction on how to incorporate JDBC-ODBC into my struts and where the ODBC should be stored in my application. Also how to reference that in my Action Servlet, I am a little unsure about this area, but would appreciate some feed back or documentation that will simplify my work. Thanks Rodney -- Sent through GMX FreeMail - http://www.gmx.net
how to add property to DataSource
Hello, I am trying to add property to DataSource object. There is addProperty( String, String) method that I used but it had no affect. My impression is that all connections are initialized after ActionServlet is loaded ( I extended ActionServlet and added properties after calling super.init()) I tried to override registrations[] array to point to my local struts-config_1_0.dtd but call to super.init() will invoke ActionServlet's registration[]. What is the right strategy to use addProperty of DataSource object? Thanks, Mark. -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.
Problem initializing (pre-selected) html:select multiple=true
Hello, I have a problem with multiple html:select struts tag initialization. I am unable to initialize the select tag with the values i retrieve from my database. I have a JSP with - a html:select multiple who will retrieve the selected compagnies I choose. - a html:options containing all the compagnies in my database I have in the Form associated with this JSP : - an attribut rattacheInitialChoisi who retrieve a String[] of compagnies already choosen - an attribut listeSociete who retrieve a ArrayList of all compagnies - an attribut rattacheSocieteChoisie who will retreive a String[] of the new chosen compagnies All these attributs are correctly initialized (I saw this in my logs files) But I am unable to initialize the selected elements of my html:select list in the jsp thanks to the rattacheInitialChoisi attribut (pre-selected the select list when the jsp appears) Has anyone experimented this and have an idea of how to do so ??? HELP Here is my code -- SiteDetailForm.java private ArrayList listeSociete = new ArrayList() ; private String[] rattacheSocieteChoisie= new String[0]; private String[] rattacheInitialChoisi = new String[0] ; public void setListeSociete(ArrayList _listeSociete) { this.listeSociete = _listeSociete; } public ArrayList getListeSociete() { return this.listeSociete; } public void setRattacheSocieteChoisie(String[] _rattacheSocieteChoisie) { this.rattacheSocieteChoisie = _rattacheSocieteChoisie; } public String[] getRattacheSocieteChoisie() { return this.RattacheSocieteChoisie; } public void setRattacheInitialChoisi(String[] _rattacheInitialChoisi) { this.rattacheInitialChoisi = _rattacheInitialChoisi; } public String[] getRattacheInitialChoisi() { return this.rattacheInitialChoisi; } --- --- SiteDetail.jsp bean:define name=SiteDetailForm property=listeSociete id=lidy/ bean:define name=SiteDetailForm property=rattacheInitialChoisi id=initial type=java.lang.String[]/ html:select property=rattacheSocieteChoisie value=initial multiple=true size=2 html:options property=idSociete collection=lidy labelProperty=raisonSociale/ /html:select --- Xavier Brunel France
application scope problem
Please Help! In my Struts-Application I create at a certain point (init Method of myClass extends ActionServlet) a Bean for the Servlet Context. ServletContext context = getServletContext(); Info info = (Info)context.getAttribute(host); if (info == null) { info = new Info(); info.setBase(test); context.setAttribute(host, info); } Later in a JSP page I have that: jsp:useBean id=info scope=application class=myPackages.Info/ pContext Bean: bean:write name=info scope=application property=base//p But I don't reach the value of the property because every time when I forward to that JSP-Page the Bean (Info) is created again and it's properties initialized with null. Any idea? What is wrong??? Hartmut Bernecker
RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope!
Hi John (or others using struts on IBM WAS), I was wondering if you have come accross any other negative implications besides the nasty show stopping Exception from using struts on WAS. (work-around provided earlier in thread) In particular I am concerned that struts makes calls to PageContext - removeAttribute(String s), while in the Jasper code used by IBM, this will remove page scope attributes only. Primarily, I am concerned with the struts class, taglib.logic.IterateTag, which appears to be written to iterate through attributes at any scope. Any heads-up about struts on IBM is much appreciated. Thanks a lot, Mark -Original Message- From: Brugge, John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 9:26 AM To: '[EMAIL PROTECTED]' Subject: RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope! Pardon my skepticism, but from all appearances, the WAS 4.0 GA release is out (nothing on the IBM WebSphere site says that the 4.0 you can now download is beta), and this particular issue is *not* resolved. The antiquated version of Jasper is still included. And from the response to my question about this on this list a month ago or so, just dropping in a new Jasper is not something that's likely to happen quickly. If this issue was just brought to their attention a couple of weeks ago (meaning that they didn't know about it), I wouldn't hold my breath on a quick resolution. I'd love to see the fix appear in a fixpack (and soon) but we tried out 4.0 as soon as it was released the end of June, primarily to see if this issue was resolved, and were disappointed. John -Original Message- From: Pravin George [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 9:26 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope! Hi everyone, I wanted to clarify the status of Struts and Websphere 4 compatability. As a business partner to IBM, we are on the beta testing program for Websphere 4.0 . This particular issue was brought to their attention a couple of weeks ago. Last week we received word that it has been fixed in the latest beta build and will not be an issue in the final GA release. Pravin George, Software Engineer, eBuilt Inc. , Irvine, CA 92614. RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope! Date: Tue, 24 Jul 2001 13:16:48 -0700 From: Calabrese, Jason [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] I'm running struts on Websphere 3.5.4 and had similar problems. This is the response I got. Check this out.. http://www.mail-archive.com/struts-user@jakarta.apache.org/msg10964.html And.. Sure thing - I already sent it but the list refused it due to its file size. As an alternative, I'll put it up on my personal FTP space and anyone who wants it can download it from there! :) Struts.jar with Form tag modifications: http://www.enfused.com/struts.jar -Original Message- From: Mark Wilson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 1:07 PM To: '[EMAIL PROTECTED]' Subject: Struts on IBM WAS 4.0 - Error removing attributes from request sc ope! Hello, thanks for you're attention. I am deploying the struts-example app on IBM Websphere App Server 4.0 and receive an IllegalArgumentException - Can't remove attribute from request scope. the situation: I have drilled into the problem and discovered that IBM is using a significantly different implementation of the class, org.apache.jasper.runtime.PageContextImpl. Their class alters the logic of removing attributes using the methods removeAttribute(String s, int i) and removeAttribute(String s). I have included the code in the next section of the e-mail. In summary, using WAS 4.0, attributes are not removed from request scope. This conflicts most directly with the struts framework class, org.apache.struts.taglib.html.FormTag. FormTag calls pageContext.removeAttribute(Constants.BEAN_KEY, PageContext.REQUEST_SCOPE) and pageContext.removeAttribute(Constants.FORM_KEY, PageContext.REQUEST_SCOPE) within the doEndTag() method. Either of these method calls will generate an IllegalArgumentException on WAS 4.0. the code (more or less): org.apache.jasper.runtime.PageContextImpl (note: not the same code as used in tomcat's implementation...) public void removeAttribute(String s, int i) { switch (i) { case PAGE_SCOPE: pageScopeAttributes.remove(s); break; case REQUEST_SCOPE: throw new IllegalArgumentException(Can't remove Attributes from request scope); case SESSION_SCOPE: if (session == null) throw new
Re: DataSource and Factories
This looks interesting, but I am not sure how I would use it. Would the strategy be to set up an action to run when the application is loaded? Would the action then obtain a reference to the data source and stow it in some repository using JNDI for use by the persistenc layer? That is the solution we think will work. Is this different from that? Thanks, Bud DataSource can be obtained either Deployment descriptor as java:comp/jdbc/MyDataSource (associate a Jndi name to the Datasource )
RE: application scope problem
Hopefully someone will be able to elaborate on this, but I don't believe you can't use jsp:useBean id=info scope=application class=myPackages.Info/ interchangablby with struts bean tags. You should be able to use: bean:define id=info scope=application name=host / then, to display: bean:write name=info property=base/ Also, make sure that you are putting the bean host into the application scope in you java code. hth D -Original Message- From: Hartmut Bernecker [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 11:00 AM To: [EMAIL PROTECTED] Subject: application scope problem Please Help! In my Struts-Application I create at a certain point (init Method of myClass extends ActionServlet) a Bean for the Servlet Context. ServletContext context = getServletContext(); Info info = (Info)context.getAttribute(host); if (info == null) { info = new Info(); info.setBase(test); context.setAttribute(host, info); } Later in a JSP page I have that: jsp:useBean id=info scope=application class=myPackages.Info/ pContext Bean: bean:write name=info scope=application property=base//p But I don't reach the value of the property because every time when I forward to that JSP-Page the Bean (Info) is created again and it's properties initialized with null. Any idea? What is wrong??? Hartmut Bernecker
RE: Newbie installation question
tomcat 4.0 doesn't work yet!! go back to 3.x -Original Message- From: Jonathan Kaplan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 10:11 AM To: [EMAIL PROTECTED] Subject: Newbie installation question Hi there, I am running Tomcat 4.0 b5. After placing the struts war files into the webapps directory, restarting tomcat, and confirming the directories had been built out, I went to struts-example and received the following stack trace: Looks to me like struts can't find some needed components... What am I missing? Thanks, -Jonathan Exception Report: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:442) at org.apache.jsp.index_jsp._jspService(index_jsp.java:454) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:200) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:254) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:194) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:255) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:225) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :163) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java: 875) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952) at java.lang.Thread.run(Thread.java:484) Root Cause: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.struts.util.RequestUtils.message(RequestUtils.java:568) at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239) at org.apache.jsp.index_jsp._jspService(index_jsp.java:94) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:200) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:254) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:194) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:255) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
The never ending story: Turning caching off
Hi everybody,I was looking for a solution for the all time favorite "Caching Problem" (in IE).I found a couple of "solutions, like: 1) Having the following lines in the JSP:response.setHeader("Pragma", "NoCache");response.setHeader("Cache-Control", "no-cache");response.setDateHeader("Expires", 1); 2) Turning "nocache" on for the ActionServlet:init-param param-namenocache/param-name param-valuetrue/param-value/init-param 3) Adding an unique parameter to the get/post, like System.currentTimeMillis() See http://www.mail-archive.com/struts-user@jakarta.apache.org/msg03176.htmlto that idea. One answer was, that usnig tokens is the key:http://www.mail-archive.com/struts-user@jakarta.apache.org/msg02888.htmlBut, correct me, if I'm wrong, what's the deal with tokens,when I don't want a JSP to be cached? I tried all of them, but with no success. So, my question is: did I misssomething or is it really just not possible? Thanks in advance,Holger
Re: application scope problem
I'm not sure exactly how the jsp:useBean looks for the class you specify, but since you are initializing the class from the ActionServlet it would be safe to assume it is there so you don't really need the jsp:useBean. So you should be able to do just this. pContext Bean: bean:write name=host scope=application property=base//p If you weren't sure if the bean existed, you could check for it with the logic:present tag. David --- Hartmut Bernecker [EMAIL PROTECTED] wrote: Please Help! In my Struts-Application I create at a certain point (init Method of myClass extends ActionServlet) a Bean for the Servlet Context. ServletContext context = getServletContext(); Info info = (Info)context.getAttribute(host); if (info == null) { info = new Info(); info.setBase(test); context.setAttribute(host, info); } Later in a JSP page I have that: jsp:useBean id=info scope=application class=myPackages.Info/ pContext Bean: bean:write name=info scope=application property=base//p But I don't reach the value of the property because every time when I forward to that JSP-Page the Bean (Info) is created again and it's properties initialized with null. Any idea? What is wrong??? Hartmut Bernecker __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope!
Why can't IBM keep up. I don't think I'd ever recommended Websphere or any other IBM java application. -Original Message- From: Boulatian, Misak [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 8:07 AM To: [EMAIL PROTECTED] Subject: RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope! It seems like you have the same problem as I was having with Powertier app server. The solution was that the powertier current release was coming with an older jasper libraries (jsp engine) but struts is using the newer ones. I hope this helps. Thanks Misak -Original Message- From: Pravin George [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 7:26 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope! Hi everyone, I wanted to clarify the status of Struts and Websphere 4 compatability. As a business partner to IBM, we are on the beta testing program for Websphere 4.0 . This particular issue was brought to their attention a couple of weeks ago. Last week we received word that it has been fixed in the latest beta build and will not be an issue in the final GA release. Pravin George, Software Engineer, eBuilt Inc. , Irvine, CA 92614. RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope! Date: Tue, 24 Jul 2001 13:16:48 -0700 From: Calabrese, Jason [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] I'm running struts on Websphere 3.5.4 and had similar problems. This is the response I got. Check this out.. http://www.mail-archive.com/struts-user@jakarta.apache.org/msg10964.html And.. Sure thing - I already sent it but the list refused it due to its file size. As an alternative, I'll put it up on my personal FTP space and anyone who wants it can download it from there! :) Struts.jar with Form tag modifications: http://www.enfused.com/struts.jar -Original Message- From: Mark Wilson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 1:07 PM To: '[EMAIL PROTECTED]' Subject: Struts on IBM WAS 4.0 - Error removing attributes from request sc ope! Hello, thanks for you're attention. I am deploying the struts-example app on IBM Websphere App Server 4.0 and receive an IllegalArgumentException - Can't remove attribute from request scope. the situation: I have drilled into the problem and discovered that IBM is using a significantly different implementation of the class, org.apache.jasper.runtime.PageContextImpl. Their class alters the logic of removing attributes using the methods removeAttribute(String s, int i) and removeAttribute(String s). I have included the code in the next section of the e-mail. In summary, using WAS 4.0, attributes are not removed from request scope. This conflicts most directly with the struts framework class, org.apache.struts.taglib.html.FormTag. FormTag calls pageContext.removeAttribute(Constants.BEAN_KEY, PageContext.REQUEST_SCOPE) and pageContext.removeAttribute(Constants.FORM_KEY, PageContext.REQUEST_SCOPE) within the doEndTag() method. Either of these method calls will generate an IllegalArgumentException on WAS 4.0. the code (more or less): org.apache.jasper.runtime.PageContextImpl (note: not the same code as used in tomcat's implementation...) public void removeAttribute(String s, int i) { switch (i) { case PAGE_SCOPE: pageScopeAttributes.remove(s); break; case REQUEST_SCOPE: throw new IllegalArgumentException(Can't remove Attributes from request scope); case SESSION_SCOPE: if (session == null) throw new IllegalArgumentException(Can't access SESSION_SCOPE without an HttpSession); theSession.removeAttribute(s); break; case APPLICATION_SCOPE: theContext.removeAttribute(s); break; } } // and ... public void removeAttribute(String s) { pageScopeAttributes.remove(s); } // (pageScopeAttributes is a Hashtable of objects stored at Page scope only!) a partial solution: Replacing the removeAttribute(String s, int i) method calls with removeAttribute(String s) within the struts class, FormTag.doEndTag() relieves the exception, but on WAS 4.0, it will not remove the attribute! (in fact, only attributes found in page scope will be removed when the method, removeAttribute(String s) is called.) testing results: Even though the attributes weren't removed from the request scope, those attributes were replaced by new objects the next time. This didn't seem to affect the observable behavior of the struts example application. the question(s): We really, really want to use struts on WAS 4.0. There seems to be some logic within struts that relates to null attributes. What are the
AW: The never ending story: Turning caching off --- Oooops
Sorry, I just figured out, that the time stamp stuff works. But I figured out another problem, that made me blind for understanding the cache problem. I'll post it soon. -Ursprngliche Nachricht-Von: Holger Wiechert [mailto:[EMAIL PROTECTED]]Gesendet: Mittwoch, 25. Juli 2001 17:25An: [EMAIL PROTECTED]Betreff: The never ending story: Turning caching off Hi everybody,I was looking for a solution for the all time favorite "Caching Problem" (in IE).I found a couple of "solutions, like: 1) Having the following lines in the JSP:response.setHeader("Pragma", "NoCache");response.setHeader("Cache-Control", "no-cache");response.setDateHeader("Expires", 1); 2) Turning "nocache" on for the ActionServlet:init-param param-namenocache/param-name param-valuetrue/param-value/init-param 3) Adding an unique parameter to the get/post, like System.currentTimeMillis() See http://www.mail-archive.com/struts-user@jakarta.apache.org/msg03176.htmlto that idea. One answer was, that usnig tokens is the key:http://www.mail-archive.com/struts-user@jakarta.apache.org/msg02888.htmlBut, correct me, if I'm wrong, what's the deal with tokens,when I don't want a JSP to be cached? I tried all of them, but with no success. So, my question is: did I misssomething or is it really just not possible? Thanks in advance,Holger
Re: Problem while running application in Struts
Hi any luck? Rakesh Ayilliath (Software Engineer) Synergy IT Innovations Pvt Ltd, #196, 1st Floor, 9th Cross, HMT Layout, RT Nagar Bangalore 560032 [EMAIL PROTECTED] www.ayilliath.8m.com - Original Message - From: Soniya Satbhai [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 25, 2001 3:17 PM Subject: Problem while running application in Struts Hi, Whenever I run my applications (jsp pages) , I am getting the following exception. Thanks, Soniya. Error: 500 Location: /struts-i18n/test.jsp Internal Servlet Error: javax.servlet.ServletException java.lang.Throwable(java.lang.String) java.lang.Exception(java.lang.String) javax.servlet.ServletException(java.lang.Throwable) void org.apache.jasper.runtime.PageContextImpl.handlePageException(java.lang.Exce ption) void _0002ftest_0002ejsptest_jsp_0._jspService(javax.servlet.http.HttpServletRequ est, javax.servlet.http.HttpServletResponse) void org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpServlet Request, javax.servlet.http.HttpServletResponse) void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(javax.servlet .http.HttpServletRequest, javax.servlet.http.HttpServletResponse, boolean) void org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpS ervletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) void org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletR equest, javax.servlet.http.HttpServletResponse) void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void org.apache.tomcat.core.ServletWrapper.doService(org.apache.tomcat.core.Reque st, org.apache.tomcat.core.Response) void org.apache.tomcat.core.Handler.service(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response) void org.apache.tomcat.core.ServletWrapper.service(org.apache.tomcat.core.Request , org.apache.tomcat.core.Response) void org.apache.tomcat.core.ContextManager.internalService(org.apache.tomcat.core .Request, org.apache.tomcat.core.Response) void org.apache.tomcat.core.ContextManager.service(org.apache.tomcat.core.Request , org.apache.tomcat.core.Response) void org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(org.a pache.tomcat.service.TcpConnection, java.lang.Object []) void org.apache.tomcat.service.TcpWorkerThread.runIt(java.lang.Object []) void org.apache.tomcat.util.ThreadPool$ControlRunnable.run() void java.lang.Thread.run() Root cause: javax.servlet.jsp.JspException java.lang.Throwable(java.lang.String) java.lang.Exception(java.lang.String) javax.servlet.jsp.JspException(java.lang.String) int org.apache.struts.taglib.bean.MessageTag.doStartTag() void _0002ftest_0002ejsptest_jsp_0._jspService(javax.servlet.http.HttpServletRequ est, javax.servlet.http.HttpServletResponse) void org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpServlet Request, javax.servlet.http.HttpServletResponse) void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(javax.servlet .http.HttpServletRequest, javax.servlet.http.HttpServletResponse, boolean) void org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpS ervletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) void org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletR equest, javax.servlet.http.HttpServletResponse) void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void org.apache.tomcat.core.ServletWrapper.doService(org.apache.tomcat.core.Reque st, org.apache.tomcat.core.Response) void org.apache.tomcat.core.Handler.service(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response) void org.apache.tomcat.core.ServletWrapper.service(org.apache.tomcat.core.Request , org.apache.tomcat.core.Response) void org.apache.tomcat.core.ContextManager.internalService(org.apache.tomcat.core .Request, org.apache.tomcat.core.Response) void org.apache.tomcat.core.ContextManager.service(org.apache.tomcat.core.Request , org.apache.tomcat.core.Response) void org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(org.a pache.tomcat.service.TcpConnection, java.lang.Object []) void
Re: Struts on IBM WAS 4.0 - Error removing attributes from request sc ope!
you're right Websphere 4.0 is a pain to work with. I did get a struts application running on 3.5.3 but not on any later version. Calabrese, Jason wrote: Why can't IBM keep up. I don't think I'd ever recommended Websphere or any other IBM java application. -Original Message- From: Boulatian, Misak [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 8:07 AM To: [EMAIL PROTECTED] Subject: RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope! It seems like you have the same problem as I was having with Powertier app server. The solution was that the powertier current release was coming with an older jasper libraries (jsp engine) but struts is using the newer ones. I hope this helps. Thanks Misak -Original Message- From: Pravin George [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 7:26 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope! Hi everyone, I wanted to clarify the status of Struts and Websphere 4 compatability. As a business partner to IBM, we are on the beta testing program for Websphere 4.0 . This particular issue was brought to their attention a couple of weeks ago. Last week we received word that it has been fixed in the latest beta build and will not be an issue in the final GA release. Pravin George, Software Engineer, eBuilt Inc. , Irvine, CA 92614. RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope! Date: Tue, 24 Jul 2001 13:16:48 -0700 From: Calabrese, Jason [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] I'm running struts on Websphere 3.5.4 and had similar problems. This is the response I got. Check this out.. http://www.mail-archive.com/struts-user@jakarta.apache.org/msg10964.html And.. Sure thing - I already sent it but the list refused it due to its file size. As an alternative, I'll put it up on my personal FTP space and anyone who wants it can download it from there! :) Struts.jar with Form tag modifications: http://www.enfused.com/struts.jar -Original Message- From: Mark Wilson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 1:07 PM To: '[EMAIL PROTECTED]' Subject: Struts on IBM WAS 4.0 - Error removing attributes from request sc ope! Hello, thanks for you're attention. I am deploying the struts-example app on IBM Websphere App Server 4.0 and receive an IllegalArgumentException - Can't remove attribute from request scope. the situation: I have drilled into the problem and discovered that IBM is using a significantly different implementation of the class, org.apache.jasper.runtime.PageContextImpl. Their class alters the logic of removing attributes using the methods removeAttribute(String s, int i) and removeAttribute(String s). I have included the code in the next section of the e-mail. In summary, using WAS 4.0, attributes are not removed from request scope. This conflicts most directly with the struts framework class, org.apache.struts.taglib.html.FormTag. FormTag calls pageContext.removeAttribute(Constants.BEAN_KEY, PageContext.REQUEST_SCOPE) and pageContext.removeAttribute(Constants.FORM_KEY, PageContext.REQUEST_SCOPE) within the doEndTag() method. Either of these method calls will generate an IllegalArgumentException on WAS 4.0. the code (more or less): org.apache.jasper.runtime.PageContextImpl (note: not the same code as used in tomcat's implementation...) public void removeAttribute(String s, int i) { switch (i) { case PAGE_SCOPE: pageScopeAttributes.remove(s); break; case REQUEST_SCOPE: throw new IllegalArgumentException(Can't remove Attributes from request scope); case SESSION_SCOPE: if (session == null) throw new IllegalArgumentException(Can't access SESSION_SCOPE without an HttpSession); theSession.removeAttribute(s); break; case APPLICATION_SCOPE: theContext.removeAttribute(s); break; } } // and ... public void removeAttribute(String s) { pageScopeAttributes.remove(s); } // (pageScopeAttributes is a Hashtable of objects stored at Page scope only!) a partial solution: Replacing the removeAttribute(String s, int i) method calls with removeAttribute(String s) within the struts class, FormTag.doEndTag() relieves the exception, but on WAS 4.0, it will not remove the attribute! (in fact, only attributes found in page scope will be removed when the method, removeAttribute(String s) is called.) testing results: Even though the attributes weren't removed from the request scope, those attributes were replaced
Changes to values in Form get lost on forward
Hi, I'm sure, this question has arised before, but I's quite hard to find it in the archive. However, this question is rather short, so I hope someone can have a short answer to it. My problem comes up, when I do the following: 1)in YYYAction.perform I set a field of the form to a new value,like System.out.println(importantString before= + myForm.getImportantString()); myForm.setImportantString(The new value); System.out.println(importantString after= + myForm.getImportantString()); 2)then I forward to ZZZAction, (this action uses the same form in the action mapping) 3)ZZZAction.perform: -retrieves some values from the database and populates the form -then forwards to the JSP, that displays the form data In step 1), I see an output like: importantString before=A cup of tea importantString after=The new value But when I look at my JSP, I still see A cup of tea as the value! Could anybody please tell me, what I'm doing wrong? Thanks, Holger
Struts Scalability in a Large Production Environment
All, I have been doing a lot of research into Struts recently. My question is about performance and scalability. First the definitions: Performance = good response time to users Scalability = good response time to a large number of simultaneous users. Usually this is a logarithmic curve that reaches a point where the server has difficulty sustaining the load. Struts will only be used for presentation logic. My Action classes in this framework will access separate business objects that will then access a BEA application server to perform the necessary business logic (EJB's) and return the results. This will be a large production environment with a large number of simultaneous users if we decide to implement this way. The Web servers will be load balanced. Even so, I don't want to implement a framework which requires me to throw a bunch of hardware at it after all is said and done. Does someone have some practical experience of the performance and scalability of the Struts framework with an overhead of 100 simultaneous users? What about 1000? Is there any kind of advice that anyone can offer me before I head down this path in relation to scalability? Thanks, Brian
AW: DataSource and Factories
Take a look to the Castor project - http://castor.exolab.org That does indeed look awesome! Do you have experience with it? Is it ready for production use? Many thanks for that great hint! Andreas
RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope!
Yes, WAS 4.0 is a big step forward in usability. However, if you look closely at the struts.jar file that is ships with, it's Struts 0.5. That notwithstanding, the console looks like a pretty sophisticated app. Probably not trivial for them to move it to Struts 1.0. John -Original Message- From: Assenza, Chris [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 11:22 AM To: '[EMAIL PROTECTED]' Subject: RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope! I had no problems with our test run with WAS 4.0 using the modified struts.jar I posted - heck the console is built with Struts. :-P Frankly, I feel like WAS 4.0 is a dream-come true as far as usability and administration. Yeah, Java isn't up to spec, but what else is new. At least it is easier to maintain. Our struts app deployed flawlessly from the EAR file without any extra manipulation from me outside of using their Application Assembly tool (ie. no moving WEB-INF, no pulling out DTD's, nadda). :D Be that as it may, our app didn't work 100%, but I am pretty sure that was an unrelated issue (IIS wasn't configured properly). Chris -Original Message- From: Pravin George [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 5:13 AM To: [EMAIL PROTECTED] Subject: Re: Struts on IBM WAS 4.0 - Error removing attributes from request sc ope! you're right Websphere 4.0 is a pain to work with. I did get a struts application running on 3.5.3 but not on any later version. Calabrese, Jason wrote: Why can't IBM keep up. I don't think I'd ever recommended Websphere or any other IBM java application. -Original Message- From: Boulatian, Misak [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 8:07 AM To: [EMAIL PROTECTED] Subject: RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope! It seems like you have the same problem as I was having with Powertier app server. The solution was that the powertier current release was coming with an older jasper libraries (jsp engine) but struts is using the newer ones. I hope this helps. Thanks Misak -Original Message- From: Pravin George [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 7:26 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope! Hi everyone, I wanted to clarify the status of Struts and Websphere 4 compatability. As a business partner to IBM, we are on the beta testing program for Websphere 4.0 . This particular issue was brought to their attention a couple of weeks ago. Last week we received word that it has been fixed in the latest beta build and will not be an issue in the final GA release. Pravin George, Software Engineer, eBuilt Inc. , Irvine, CA 92614. RE: Struts on IBM WAS 4.0 - Error removing attributes from reques t sc ope! Date: Tue, 24 Jul 2001 13:16:48 -0700 From: Calabrese, Jason [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] I'm running struts on Websphere 3.5.4 and had similar problems. This is the response I got. Check this out.. http://www.mail-archive.com/struts-user@jakarta.apache.org/msg10964.html And.. Sure thing - I already sent it but the list refused it due to its file size. As an alternative, I'll put it up on my personal FTP space and anyone who wants it can download it from there! :) Struts.jar with Form tag modifications: http://www.enfused.com/struts.jar -Original Message- From: Mark Wilson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 1:07 PM To: '[EMAIL PROTECTED]' Subject: Struts on IBM WAS 4.0 - Error removing attributes from request sc ope! Hello, thanks for you're attention. I am deploying the struts-example app on IBM Websphere App Server 4.0 and receive an IllegalArgumentException - Can't remove attribute from request scope. the situation: I have drilled into the problem and discovered that IBM is using a significantly different implementation of the class, org.apache.jasper.runtime.PageContextImpl. Their class alters the logic of removing attributes using the methods removeAttribute(String s, int i) and removeAttribute(String s). I have included the code in the next section of the e-mail. In summary, using WAS 4.0, attributes are not removed from request scope. This conflicts most directly with the struts framework class, org.apache.struts.taglib.html.FormTag. FormTag calls pageContext.removeAttribute(Constants.BEAN_KEY, PageContext.REQUEST_SCOPE) and pageContext.removeAttribute(Constants.FORM_KEY, PageContext.REQUEST_SCOPE) within the doEndTag() method. Either of these method
Error with Data Sources
I'm trying to configure a data-source in my struts-config.xml file and I get the following error: Parse Error at line 71 column -1: Element struts-config allows no further input; data-sources is not allowed. ...(more traceback here)... The snippet from my struts-config.xml file is as follows: data-sources data-source set-property property=autoCommit value=false / set-property property=description value=Postgres Server/ set-property property=driverClass value=org.postgresql.Driver/ set-property property=maxCount value=4/ set-property property=minCount value=2/ set-property property=password value=zsdc980/ set-property property=url value=jdbc:postgresql://localhost/LPC/ set-property property=user value=edwardam/ /data-source /data-sources What am I doing wrong? -- Edward Muller Director of Information Services LearningPatterns.com Inc. Direct: 212-487-9064 x 115 Fax: 212-202-3822 Email: [EMAIL PROTECTED] http://www.learningpatterns.com
Re: Problem initializing (pre-selected) html:select multiple=true
Hi. If you want Struts to display values pre-selected, you should leave off the value= on the select tag altogether. I haven't tried it with multiple=true, but use html:select property=category to display the value I previously assigned in my form under category. Would assume it would work with multiple=true too... Cheers, Dave Xavier Brunel [EMAIL PROTECTED] on 07/25/2001 10:57:14 AM Please respond to [EMAIL PROTECTED] To: 'Struts-User [EMAIL PROTECTED] cc:(bcc: David Hay/Lex/Lexmark) Subject: Problem initializing (pre-selected) html:select multiple=true Hello, I have a problem with multiple html:select struts tag initialization. I am unable to initialize the select tag with the values i retrieve from my database. I have a JSP with - a html:select multiple who will retrieve the selected compagnies I choose. - a html:options containing all the compagnies in my database I have in the Form associated with this JSP : - an attribut rattacheInitialChoisi who retrieve a String[] of compagnies already choosen - an attribut listeSociete who retrieve a ArrayList of all compagnies - an attribut rattacheSocieteChoisie who will retreive a String[] of the new chosen compagnies All these attributs are correctly initialized (I saw this in my logs files) But I am unable to initialize the selected elements of my html:select list in the jsp thanks to the rattacheInitialChoisi attribut (pre-selected the select list when the jsp appears) Has anyone experimented this and have an idea of how to do so ??? HELP Here is my code -- SiteDetailForm.java private ArrayList listeSociete = new ArrayList() ; private String[] rattacheSocieteChoisie= new String[0]; private String[] rattacheInitialChoisi = new String[0] ; public void setListeSociete(ArrayList _listeSociete) { this.listeSociete = _listeSociete; } public ArrayList getListeSociete() { return this.listeSociete; } public void setRattacheSocieteChoisie(String[] _rattacheSocieteChoisie) { this.rattacheSocieteChoisie = _rattacheSocieteChoisie; } public String[] getRattacheSocieteChoisie() { return this.RattacheSocieteChoisie; } public void setRattacheInitialChoisi(String[] _rattacheInitialChoisi) { this.rattacheInitialChoisi = _rattacheInitialChoisi; } public String[] getRattacheInitialChoisi() { return this.rattacheInitialChoisi; } --- --- SiteDetail.jsp bean:define name=SiteDetailForm property=listeSociete id=lidy/ bean:define name=SiteDetailForm property=rattacheInitialChoisi id=initial type=java.lang.String[]/ html:select property=rattacheSocieteChoisie value=initial multiple=true size=2 html:options property=idSociete collection=lidy labelProperty=raisonSociale/ /html:select --- Xavier Brunel France
struts and WAP
hi all, i am wondering if there are any thoughts/process going on to support WML taglibs in struts. or is there anything already available. thanks, rama.
Re: struts and WAP
A Struts WML taglib is on the To Do List for 1.1, but no one has volunteered to work on it yet. http://jakarta.apache.org/struts/todo-1.1.html David --- Rama Krishna [EMAIL PROTECTED] wrote: hi all, i am wondering if there are any thoughts/process going on to support WML taglibs in struts. or is there anything already available. thanks, rama. __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
Re: Indexed properties
At 02:23 PM 7/25/2001 -0400, you wrote: Nathan, Hi. Currently you have to use my changed tags...but it looks like they will be in the nightly build by the end of the week. You can get them at http://husted.com/about/struts/indexed-tags.htm, and I attached some example source code to a previous message which was just mentioned, if you want to look at that. Cheers, Dave I have a couple of questions about your mods. At our site we are using a different set of modifications, posted by some other Struts user which seems to accomplish the same thing as your mods. The major difference seems to be that yours requires an additional attribute to specify that the particular input field is to use an indexed property accessor. I'm curious as to why you made this choice? The mods we are using automatically use an indexed accessor if the input field is contained inside of an iterate tag. Do you have an example of when you would have an input field inside of an iterate tag when you wouldn't want to use an indexed property name? (I'm not trying to argue with your decision, just trying to get a better understanding of your thoughts). The other issue, which we just came across today, with the other indexed property mod, is that it would fail to work correctly if you had iterators inside of iterators. We had a case where we used an iterator to access a collection of beans, and then iterated over the contents of each of the beans. The resultant HTML needed to look like this to work correctly: input type=text name=firstTable[n].secondTable[m].propertyName Will your mods handle nested iterators correctly? Finally, are your mods going to be part of the official build, or are they included in some sort of user supplied extensions? I missed the original discussion about your modifications. Thanks! James W. Howe mailto:[EMAIL PROTECTED] Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html Ann Arbor, MI 48103
Trying to add errors to an existing errors object after using the validation framework
I am using the Validation Framework within struts and I need to perform some validations that I cannot do using the framework. I have created an ActionForm that extends ValidatorForm and in my validate method I first call super.validate. Once the errors have been returned I then perform my own additonal validations and add to the errors object returned from the super.validate. I then return the errors object from my validate routine. All appears to work ok if I use the standard struts errors tags to present the errors on the page. However if I use the tags that come with the validator i get the following exception only when processing errors that I created: Error: 500 Location: /EnrollmentCapture.jspInternal Servlet Error:javax.servlet.ServletException at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459) at _0002fEnrollmentCapture_0002ejspEnrollmentCapture_jsp_2._jspService(_0002fEnrollmentCapture_0002ejspEnrollmentCapture_jsp_2.java:1941) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:194) at org.apache.struts.action.ActionServlet.processValidate(ActionServlet.java:2137) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) 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:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) Root cause: java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:380) at org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java:251) at com.wintecinc.struts.taglib.html.ErrorsTag.doAfterBody(ErrorsTag.java:296) at _0002fEnrollmentCapture_0002ejspEnrollmentCapture_jsp_2._jspService(_0002fEnrollmentCapture_0002ejspEnrollmentCapture_jsp_2.java:443) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:194) at org.apache.struts.action.ActionServlet.processValidate(ActionServlet.java:2137) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) 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:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) I am sure it is the way I am creating
Re: Trying to add errors to an existing errors object after using the validation framework
Problem Solved: After rooting around in my ApplicationResources.properties file I found a misspelling in my message name. I would have expected the framework to catch the error in the lookup similar to what happens in other areas of struts when a message resource cannot be found. Typically a message tells you that XXX.title could not be found. Perhaps this test is done within the validation framework and my bypass caused an unforseen problem. Scott Ryan Developer First Bank Data Corporation Work: (303) 235-1485 Cell:(303 263-3044 [EMAIL PROTECTED] 07/25/01 01:39PM I am using the Validation Framework within struts and I need to perform some validations that I cannot do using the framework. I have created an ActionForm that extends ValidatorForm and in my validate method I first call super.validate. Once the errors have been returned I then perform my own additonal validations and add to the errors object returned from the super.validate. I then return the errors object from my validate routine. All appears to work ok if I use the standard struts errors tags to present the errors on the page. However if I use the tags that come with the validator i get the following exception only when processing errors that I created: Error: 500 Location: /EnrollmentCapture.jspInternal Servlet Error:javax.servlet.ServletException at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459) at _0002fEnrollmentCapture_0002ejspEnrollmentCapture_jsp_2._jspService(_0002fEnrollmentCapture_0002ejspEnrollmentCapture_jsp_2.java:1941) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:194) at org.apache.struts.action.ActionServlet.processValidate(ActionServlet.java:2137) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) 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:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) Root cause: java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:380) at org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java:251) at com.wintecinc.struts.taglib.html.ErrorsTag.doAfterBody(ErrorsTag.java:296) at _0002fEnrollmentCapture_0002ejspEnrollmentCapture_jsp_2._jspService(_0002fEnrollmentCapture_0002ejspEnrollmentCapture_jsp_2.java:443) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:194) at org.apache.struts.action.ActionServlet.processValidate(ActionServlet.java:2137) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) 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:404) at
Form declaration inside logic:equal tags
Hello everyone, I was just wondering why I cannot use a code like this: logic:equal name=userForm property=action value=Profile html:form action=/saveUserProfile /logic:equal logic:notEqual name=userForm property=action value=Profile html:form action=/saveUser /logic:notEqual I always get exception: Non-matching extension tags probably occurred due to an error in /user.jsp line 60: /logic:equal I have a lot of logic:equal tags on my page and they worked fine untill I tried to wrap html:form inside them. Thank you for your time. Best of luck, Yuriy Zubarev __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
calling actionmapping from a URL
Hi I have a action class that is used in several actionmappings and in some situations it is called directly from a url, like href=myaction.do, but in these cases the validation implemented prevents me from continuing the process. My question is: how can i turn off validation when calling a action class from a URL. thanks in advance Jan Fredrik ___ Jan Fredrik Øveraasen | Senior Systems Developer ___ Cell Network ASA | Pb. 5313, Sørkedalsv. 10A, N-0304 Oslo, Norway ___ Tel: +47 23196600/35 | Fax: +47 23196601 | Mob: +47 93 49 99 88 ___ http://www.cellnetwork.com/ | mailto:[EMAIL PROTECTED]
Re: Indexed properties
At 05:20 PM 7/25/2001 -0400, you wrote: Hi James, Thanks for your note - made me think a bit! Would be interested in knowing more about the other indexed tags that were posted and you are using. I know either Jeff Trent or Martin Cooper had produced some tags which had a different name ie IndexedXXXTag. I believe the mods we have are based on those posted by Niall Pemberton. In those mods, a handful of HTML tags had their doStartTag() method modified to be changed from: results.append( name=\); results.append(this.property); to results.append( name=\); results.append(propertyName()); where propertyName() was implemented like this: protected String propertyName() { IterateTag iterateTag = (IterateTag) findAncestorWithClass(this, IterateTag.class); return iterateTag == null ? this.property : iterateTag.getProperty() + [ + iterateTag.getIndex() + ]. + this.property; } In the original mods that we had, the getProperty method of IterateTag simply returned the property field value. I modified it to invoke a propertyName() method whose implementation is the same as that given above. This allows for a recursive buildup of indexed property fields when an HTML tag is included inside of any number of nested iterate tags. James W. Howe mailto:[EMAIL PROTECTED] Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html Ann Arbor, MI 48103
Re: calling actionmapping from a URL
The ActionMapping has a property for validation. To call the Action without validation, set validate=false in your ActionMapping. An Action is not a servlet, and you cannot call it directly from an URL. In every case, the request is passed to the ActionServlet by the container. The ActionServlet determines which Action to use by referring to the ActionMappings. So in the example case, you must have mapping named myaction, or else it could not be called. You may wish to set validate=false for that mapping, and leave it at true for the others. If there is some other type of validation occuring in your Action, which you put in yourself, you could check the mapping object passed to perform() to see if validation should be used or not. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/ Jan Fredrik Øveraasen wrote: Hi I have a action class that is used in several actionmappings and in some situations it is called directly from a url, like href=myaction.do, but in these cases the validation implemented prevents me from continuing the process. My question is: how can i turn off validation when calling a action class from a URL. thanks in advance Jan Fredrik ___ Jan Fredrik Øveraasen | Senior Systems Developer ___ Cell Network ASA | Pb. 5313, Sørkedalsv. 10A, N-0304 Oslo, Norway ___ Tel: +47 23196600/35 | Fax: +47 23196601 | Mob: +47 93 49 99 88 ___ http://www.cellnetwork.com/ | mailto:[EMAIL PROTECTED]
Re: full featured example
Try Steve Wilkinson's site, http://www.newparticles.com/struts/ . He'll be do some more work on this soon, and moving it to jBoss. And, if you end up with some good working examples in your own applications, feel free to donate them to the cause ;-) -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/ Stephen LeClair wrote: Do we have any full featured example sites available? I tried to follow the myCart link on the resources page but got a permissions error and couldn't find any active links on the page that came up. I'd like to see working examples of select lists, nested iterators, etc that are more real world that what we find in the examples that come with the distribution. Thanks in advance...Steve
Re: Empty Page returned after Action executed
Hello, I have had this problem when I reference a forward that doesn't exist in my config file. You mention that your action returns a reference to continue: (mapping.findForward(continue)) But your line in your struts-config is: forward name=success path=/shipsum.jsp/ rename your forward to continue or return a reference to success like this: (mapping.findForward(success)) Bill Randall Dietz wrote: I'm new to Struts (V1.0) and I'm stuck on what I think is a simple example. I have an Action and an ActionForm bean that do pretty much nothing. Action simply returns a reference to continue (mapping.findForward(continue)) and the ActionForm bean has one attribute, title. What's happening is that when I execute the action (using html:link page=/shipsum.do), the JSP associated with the action is not being displayed. There are no errors, just an empty HTML page with an empty body. Here are the form-bean and action entries I use in my config file: form-bean name=summaryForm type=com.mim.pilot2.SummaryForm/ action path=/shipsum type=com.mim.pilot2.SummaryAction name=summaryForm scope=request input=/shipsum.jsp / Note that by using System.out I have verified that my SummaryAction class is being executed. And... it also does not work if I specify forward as shown below: action path=/shipsum type=com.mim.pilot2.SummaryAction name=summaryForm scope=request input=/shipsum.jsp forward name=success path=/shipsum.jsp/ /action But... if I use the entry: action path=/shipsum forward=/shipsum.jsp / shipsum.jsp is displayed correctly. Under what conditions does Struts return an empty HTML page? Can someone spot my error? Thanks, = Randall Dietz IT Consultant Email: [EMAIL PROTECTED] ** The information contained in this e-mail is confidential and is intended only for the use of the addressee(s). If you receive this e-mail in error, any use, distribution or copying of this e-mail is not permitted. You are requested to forward unwanted e-mail and address any problems to the MIM Holdings Limited Support Centre. e-mail: [EMAIL PROTECTED] phone: Australia 1800500646 International ++61 7 38338042 **
Re: Encodings on form submits?
I know this is an old post, but better late than never... :-) We are doing the following: 1) Specify the content type for the JSP output: %@ page contentType=text/html; charset=utf-8 % You can also do this by setting the content type header manually, using response.setContentType(). 2) Specify the content type to the browser: meta http-equiv=content-type content=text/html; charset=utf-8 3) Specify the default content type to the container. In our case, we are using Resin, and so do this: web-app id='/' character-encoding='utf-8' ... The first ensures that the JSP page is treated as UTF-8, which can represent all the characters you need. The second ensures that the browser knows that. Since the browser uses the encoding of the page to send form data, submissions will now use UTF-8. The third ensures that the container interprets all submissions as UTF-8. Other than figuring it out in the first place :-) we have had no problems with this. We can correctly display, and interpret input, in any language - Chinese, Japanese, European languages, etc. -- Martin Cooper - Original Message - From: Ben Flaumenhaft [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 05, 2001 1:40 PM Subject: Encodings on form submits? Folks, I'm struggling with how to handle form submissions with non-Latin character encodings using a Struts action and form beans. As I understand it, browsers use the character encoding of the form's page (hex-encoded) for submitting form parameters. I've seen plenty of code to convert request parameters by hand, e.g. try { return new String(inParam.getBytes(8859_1), encoding); } catch (UnsupportedEncodingException e) { return inParam; } ... but this implies that you know the character encoding. Until Servlet 2.3 is standard, you can't just say request.setEncoding (). So: how to do this in Struts? Ultimately, what I need is my form beans to have their Strings set properly. I can think of a few ways. (1) Let the form bean handle it on set () methods for Strings. Every form class could extend a base class with a decodeString (), and every form class could call this method. I'm not thrilled about this, since it'd be easy to forget and it's a lot of extra coding on every set call. (2) Modify Struts to do this automatically. This isn't trivial, since the calls to populate beans are buried pretty deeply in ActionServlet, RequestUtils, and BeanUtils. In either case, the handler (whether Struts utils or the beans themselves) would need to know the encoding to use! The best I can come up with is that every form would embed a hidden parameter encoding -- this is how iPlanet handles this, they have a j_encoding parameter on forms which tells the handler how to decode params. (I could modify html:form to do this automatically, too ...) Thoughts? Thanks, Ben
RE: full featured example
I just got through reviewing the sample in JSP 2nd Edition Wrox book (Steve Wilkinson authored the Struts chapter) and it helped. I'll check out his site, thanks! If we get a good sample site put together for our new hires, I'll post a link... ...Steve -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 8:26 PM To: [EMAIL PROTECTED] Subject: Re: full featured example Try Steve Wilkinson's site, http://www.newparticles.com/struts/ . He'll be do some more work on this soon, and moving it to jBoss. And, if you end up with some good working examples in your own applications, feel free to donate them to the cause ;-) -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/ Stephen LeClair wrote: Do we have any full featured example sites available? I tried to follow the myCart link on the resources page but got a permissions error and couldn't find any active links on the page that came up. I'd like to see working examples of select lists, nested iterators, etc that are more real world that what we find in the examples that come with the distribution. Thanks in advance...Steve
Re: Error with Data Sources
Okay. I figured out that data-sources needs to go at the tope and I removed the set-property tags and actually made the properties. I am using postgres 7.1 something. Now when I start my sample application I get a ClassNotFoundException. I've checked and postgresql.jar from my postgres install is in my apps WEF-INF/lib directory. I've got the application working by establishing my own connections and not using the pool, so I know I can talk to JDBC and it can load the driver. But I can't seem to get the strut-pool stuff to load it Can anyone point out my stupid mistake? Here is my data-sources section: data-sources data-source autoCommit=false driverClass=org.postgresql.Driver maxCount=4 minCount=2 password=whatever url=jdbc:postgresql://localhost/LPC user=edwardam / /data-sources On 25 Jul 2001 14:05:00 -0400, Edward Muller wrote: I'm trying to configure a data-source in my struts-config.xml file and I get the following error: Parse Error at line 71 column -1: Element struts-config allows no further input; data-sources is not allowed. ...(more traceback here)... The snippet from my struts-config.xml file is as follows: data-sources data-source set-property property=autoCommit value=false / set-property property=description value=Postgres Server/ set-property property=driverClass value=org.postgresql.Driver/ set-property property=maxCount value=4/ set-property property=minCount value=2/ set-property property=password value=whatever/ set-property property=url value=jdbc:postgresql://localhost/LPC/ set-property property=user value=edwardam/ /data-source /data-sources What am I doing wrong? -- Edward Muller Director of Information Services LearningPatterns.com Inc. Direct: 212-487-9064 x 115 Fax: 212-202-3822 Email: [EMAIL PROTECTED] http://www.learningpatterns.com -- Edward Muller Director of Information Services LearningPatterns.com Inc. Direct: 212-487-9064 x 115 Fax: 212-202-3822 Email: [EMAIL PROTECTED] http://www.learningpatterns.com
Re: Missing type on declaration - any poniters 1 error left
I think your compiler can't find the initial class declaration. Chances are your actual syntax error occured before that line. Make sure you don't have too many '}' and that you're making a valid class declaration. It seems that a lot of your problems has more to do with your understanding of Java than with Struts. You might want to check out some general java language message groups, as they might be better at explaining the problems you are experiencing. Calvin On 25 Jul 2001 12:51:08 +0100, Chuck Amadi wrote: Hi i have got it done to 1 error as below webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java [9:1] 'class' or 'interface' keyword expected. public ActionForward perform (ActionMapping mapping, ^ 1 error Errors compiling ActionForward. Chuck Amadi wrote: Hi, can someone take a peek at my ActionFoward Class - webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java [10:1] Missing type on declaration public perform(ActionMapping mapping, ^ webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java [35:1] Type expected or missing '}' ^ 2 errors Errors compiling ActionForward. - package classes.org.apache.struts.action; /*Accessing Relational Databases *Struts can define the datasources for an application from within its standard configuration file. A simple JDBC connection pool is also provided. *See The Action Mappings Configuration File section and the Utilities Developer Guide for details. *After the datasource is defined, here is an example of establishing a connection from within a Action perform method.*/ public class ActionForward { public perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ try { javax.sql.DataSource dataSource = servlet.findDataSource(null); java.sql.Connection myConnection = dataSource.getConnection(); //do what you wish with myConnection } catch (SQLException sqle) { getServlet().log(Connection.process, sqle); } finally { //enclose this in a finally block to make //sure the connection is closed try { myConnection.close(); } catch (SQLException e) { getServlet().log(Connection.close, e); } } } The path is C:/jakarta-tomcat-3.2.2/webapps/bbnpa/WEB-INF/classes/ do i need to creatE a base dir i.e C:/jakarta-tomcat-3.2.2/webapps/bbnpa/action/WEB-INF/classes/org/apache/struts/action/ActionForward Cheers Chuck -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
RE: Missing type on declaration - any poniters 1 error left
You need to close the brace on your class declaration I believe. Like this: public class ActionForward { public perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { try { javax.sql.DataSource dataSource = servlet.findDataSource(null); java.sql.Connection myConnection = dataSource.getConnection(); //do what you wish with myConnection } catch (SQLException sqle) { getServlet().log(Connection.process, sqle); } finally { //enclose this in a finally block to make //sure the connection is closed try { myConnection.close(); } catch (SQLException e) { getServlet().log(Connection.close, e); } } } } -- Add this brace here -Original Message- From: Calvin Yu [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 7:55 PM To: [EMAIL PROTECTED] Subject: Re: Missing type on declaration - any poniters 1 error left I think your compiler can't find the initial class declaration. Chances are your actual syntax error occured before that line. Make sure you don't have too many '}' and that you're making a valid class declaration. It seems that a lot of your problems has more to do with your understanding of Java than with Struts. You might want to check out some general java language message groups, as they might be better at explaining the problems you are experiencing. Calvin On 25 Jul 2001 12:51:08 +0100, Chuck Amadi wrote: Hi i have got it done to 1 error as below webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java [9:1] 'class' or 'interface' keyword expected. public ActionForward perform (ActionMapping mapping, ^ 1 error Errors compiling ActionForward. Chuck Amadi wrote: Hi, can someone take a peek at my ActionFoward Class -- --- webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java [10:1] Missing type on declaration public perform(ActionMapping mapping, ^ webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java [35:1] Type expected or missing '}' ^ 2 errors Errors compiling ActionForward. -- --- package classes.org.apache.struts.action; /*Accessing Relational Databases *Struts can define the datasources for an application from within its standard configuration file. A simple JDBC connection pool is also provided. *See The Action Mappings Configuration File section and the Utilities Developer Guide for details. *After the datasource is defined, here is an example of establishing a connection from within a Action perform method.*/ public class ActionForward { public perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ try { javax.sql.DataSource dataSource = servlet.findDataSource(null); java.sql.Connection myConnection = dataSource.getConnection(); //do what you wish with myConnection } catch (SQLException sqle) { getServlet().log(Connection.process, sqle); } finally { //enclose this in a finally block to make //sure the connection is closed try { myConnection.close(); } catch (SQLException e) { getServlet().log(Connection.close, e); } } } The path is C:/jakarta-tomcat-3.2.2/webapps/bbnpa/WEB-INF/classes/ do i need to creatE a base dir i.e C:/jakarta-tomcat-3.2.2/webapps/bbnpa/action/WEB-INF/classes/org/apache/stru ts/action/ActionForward Cheers Chuck -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi. -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park
newbie question
Hi,all Why can't correctly run the "struts-example"? When I click the url in index.jsp,it throw the a error like following: "The requested URL /struts-example/tour.do;jsessionid=5ox6pc4q91 was not found on this server." why? pls help me, thx. Regards,Jonathan
RE: newbie question
What steps did you take to get to that point? What web container are you using? -Original Message-From: Jonathan Yang [mailto:[EMAIL PROTECTED]]Sent: Wednesday, July 25, 2001 8:35 PMTo: strutsSubject: newbie question Hi,all Why can't correctly run the "struts-example"? When I click the url in index.jsp,it throw the a error like following: "The requested URL /struts-example/tour.do;jsessionid=5ox6pc4q91 was not found on this server." why? pls help me, thx. Regards,Jonathan
Re: newbie question
The appserver is tomcat3.2.3. can sucessfully show the index.jsp, and when I click the url, the error appear... It seems that it can't know the *.do, how I can resolve it? Regards,Jonathan - Original Message - From: Kevin McLain To: [EMAIL PROTECTED] Sent: Thursday, July 26, 2001 11:37 AM Subject: RE: newbie question What steps did you take to get to that point? What web container are you using? -Original Message-From: Jonathan Yang [mailto:[EMAIL PROTECTED]]Sent: Wednesday, July 25, 2001 8:35 PMTo: strutsSubject: newbie question Hi,all Why can't correctly run the "struts-example"? When I click the url in index.jsp,it throw the a error like following: "The requested URL /struts-example/tour.do;jsessionid=5ox6pc4q91 was not found on this server." why? pls help me, thx. Regards,Jonathan
Digester addObjectCreate
I have an object that takes an argument in the Constructor. How do I do this during an addObjectCreate call?
Re: Workflow impasse? and more
Nic, I've removed your name from the to-do sections per your request. However, I hope we'll still see your comments and suggestions in these areas as they develop. Regarding workflow, I look forward to hearing your thoughts on handling multi-page forms, and how this might relate to a more general workflow solution. -- Martin Cooper - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 25, 2001 2:23 AM Subject: Re: Workflow impasse? and more Hi All, Well I've finally got around to moving my struts subscriptions to a different address so I can setup rules etc to manage the number of mails on the lists! Moving them away from my work mail address is a good thing... So why am I telling you all this? Well I , like Craig T, signed up for several areas on the 1.1 Todo list a while back and like Craig have been busy with work and being away on holiday and training. So keeping up with the volume of mail has been difficult let alone contributing anything constructive. So I, like Craig, am going to have to cut down what I am involved in to make it fair to others and be able to contribute properly without spreading myself too thin. So I am going to back out of the following areas for the following reasons: Standard Validations Client Side Validations - because I have not done the work I expected to in this area and therefore feel I probably shouldn't buttin on these! EJB Design Patterns - for similar reasons. Although I have been working with EJBs I think there are others who are better qualified to lead this piece. I will of course contribute where possible to these areas but feel I am unable to lead them or take a direct role in designing/writing these. Which leaves the following: Multi-page form support - I think this really may tie in with the Workflow processing Workflow processing - I am working on workflow at the moment from a 'backend' perspective i.e. at the EJB layer which I hope will help cement my ideas for the Struts workflow. More on this later. Role-based Action Execution - I have been looking at JAAS and security in general and need to look into the specs a bit more to understand what _must_ be supported by containers and what _tends_ to be supported before we make a decision on exactly where to go withthis. Again more later. I hope this will enable to contribute more than I have in the past and get things moving. Apologies for anyone expecting me to take the others areas through to completion. So on to Workflow. As Ted suggests I also believe the fundamentals are there in the framework already. There have been several discussions about exactly what the workflow piece is but I think Ted's implications are the best. I don't think we are trying to design something that is a GUI nor are we trying to make something that conforms to standards which are in their infancy. This is not to say that support for products ( I think Visio for instance was suggested) should not come later but I think this is in addition to the underlying functionality which is to link Actions together to form a business process with pre- and post-requirements. This is where the thought on the multi-page forms comes in. I have been thinking about this a lot lately and have a few ways of doing this which when I cement them a little more will post here. I think we need to get down a solid set of requirements ( I think Ted's are a good start) and be clear what we are trying to achieve (I have tried to outline my view above) before we can proceed and I will take a proper look at the code examples Ted outlines in his mail. Much of the discussion so far has been on several tracks all under the global term 'workflow'. (Please don't take any of this as criticism - I am aware I haven't contributed much up until now - just observations and an attempt to get this going). So any comments on what we are trying to achieve and how? (and I am waiting for the slap too... ;) And then the security thing I have been primarily working with BEA Weblogic and working on a banking system so security has been key. We have had various discussions with BEA and finally got some answers so I have a clear idea of how BEA do things and how we may be able to fit this in to struts. What is currently not clear and Craig M has alluded to before is that the specs aren't really explicit in this area and each application server tends to do things in its own way. So I intend to look at the specs a little more to see what they should at least all support and then work on whether we want to link something into that or produce a struts specific implementation ( which obviously should abstract things so that people can plug in their app server specific stuff if necessary, although Struts is unlikely, at least at this stage,
Re: calling actionmapping from a URL
Hello Jan, Thursday, July 26, 2001, 1:40:48 AM, you wrote: JFØ Hi JFØ I have a action class that is used in several actionmappings and in some JFØ situations it is called directly JFØ from a url, like href=myaction.do, but in these cases the validation JFØ implemented prevents me from continuing the process. JFØ My question is: how can i turn off validation when calling a action class JFØ from a URL. Is is simple - set validate attribute in action mapping to false: actionpath=/registration/register name=registrationForm input=/WEB-INF/jsp/registration.jsp validate=true type=com.rb.action.RegisterAction forwardname=confirm path=/WEB-INF/jsp/confirmRegister.jsp/ /action -- Best regards, Olegmailto:[EMAIL PROTECTED]
Commercial support for Struts
Hi I'm looking at using Struts for a large project but the organisation is not keen on open-source, mainly because they like to be able to point at a company when something goes wrong or help is needed. Personally, I have a lot of confidence in the support available for this particular open-source project but I am having a hard time convincing our organisation. Does anyone know of a company that provides commercial support for Struts? Alternatively, anyone have any other suggestions?? I'm really looking forward to sinking my teeth into Struts so I hope a solution is found soon. Regards, Justin Hartley