Re: Problem in validation?
This can be validated using the basic validators provided by the struts framework itself. just specify the validators you want (like required, minLength, maxLength etc) in the validatior-rules.xml and associate this with your form using the validation.xml file. Sriman Venkatasubbu , Tidel Park - Chennai wrote: I am very new to struts... In my jsp page i am creating dynamic form elements.I want to validate those form elements by using validator.xml. Is it possible to validate dynamic text boxes(form elements) ?If it is possible ,how can i configure in validator.xml. Thanks Sriman - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: FW: Migrating from Struts 1.0.2 to 1.1
Thanks for the effort. I am properly closing action-mappings tag in my struts-config.xml.(It is placed after closing all the action tags and before /struts-config tag) but mistakenly I missed out when I copied that from structs-config.xml to mail. Jyothikumar. -Original Message- From: Koni Roth [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:31 AM To: Struts Users Mailing List Subject: Re: FW: Migrating from Struts 1.0.2 to 1.1 /action-mappings is missing! Gopalakrishnan, Jyothikumar wrote: Hi All, While migrating from Struts 1.0.2 to Struts 1.1 (on Weblogic 6.1SP3, Solaris 6), I am stuck with this problem. This mailing list is now my last resort. Here is my struts-config.xml ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd; !-- This is the Struts configuration file for the example application, using the proposed new syntax. -- struts-config !-- == Form Bean Definitions === -- form-beans !-- Login form -- form-bean name=login type=com.ptc.ams.forms.LogonForm set-property property=username value=test / /form-bean /form-beans !-- == Action Mapping Definitions == -- action-mappings actionpath=/logon type=com.ptc.ams.actions.LogonAction name=login input=/src/index.jsp scope=request validate=true forward name=success path=/src/jsp/m_index.jsp/ forward name=failed path=/src/index.jsp / /action /struts-config When I deploy the application, I get following message and application does not work. If I remove the set-property / line from the struts config, it works fine. I am totally lost on this, any help is appreciated. javax.servlet.UnavailableException: Parsing error processing resource path at org.apache.struts.action.ActionServlet.handleConfigException(ActionServl et.java:1035) at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServl et.java:1014) at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.ja va:955) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl. java:713) at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImp l.java:656) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl .java:601) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServ letContext.java:2272) at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppSer vletContext.java:2216) at weblogic.servlet.internal.WebAppServletContext.init(WebAppServletContext .java:900) at weblogic.servlet.internal.WebAppServletContext.init(WebAppServletConte xt.java:823) at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:444) at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:78) at weblogic.j2ee.Application.deploy(Application.java:271) at weblogic.j2ee.J2EEService.deployApplication(J2EEService.java:190) at weblogic.management.mbeans.custom.Application.setLocalDeployed(Applicati on.java:366) at weblogic.management.mbeans.custom.Application.setDeployed(Application.ja va:300) at java.lang.reflect.Method.invoke(Native Method) at weblogic.management.internal.DynamicMBeanImpl.invokeSetter(DynamicMBeanI mpl.java:1401) at weblogic.management.internal.DynamicMBeanImpl.setAttribute(DynamicMBeanI mpl.java:894) at weblogic.management.internal.DynamicMBeanImpl.setAttribute(DynamicMBeanI mpl.java:847) at weblogic.management.internal.ConfigurationMBeanImpl.setAttribute(Configu rationMBeanImpl.java:296) at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java :1358) at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java :1333) at weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBeans(C onfigurationMBeanImpl.java:393) at weblogic.management.internal.ConfigurationMBeanImpl.setAttribute(Configu rationMBeanImpl.java:299) at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java :1358) at
Struts modules does not work with Tiles, is there a tiles plugin problem?
Hi ! I have two web applications developed with Struts that are linked together using the struts modules. The pages worked well but after we have passed to Tiles when we try to do the integration via the same procedure, i mean the struts modules, seems that the tiles plugin is never called as the second tiles definition (the one for the module) seems that is never read. Does anyone 'meet' this situation ? How can I solve this? Many thanks, Ionel Condor.
RE: Struts modules does not work with Tiles, is there a tiles plugin problem?
This is just a guess - (I have no idea what Im talking about ,I just remember seeing this somewhere) - do you link straight to your JSPs? If so you wont hit the controller (tile request processor) so it can get confused when modules are involved. You might need to use a SwitchAction or something like that? (but like I said, Im not really sure (dont use tile myself) and so thats all just a guess based on hearsay :-) -Original Message- From: Ionel D Condor [mailto:[EMAIL PROTECTED] Sent: Monday, 21 July 2003 14:47 To: Struts Users Mailing List Subject: Struts modules does not work with Tiles, is there a tiles plugin problem? Hi ! I have two web applications developed with Struts that are linked together using the struts modules. The pages worked well but after we have passed to Tiles when we try to do the integration via the same procedure, i mean the struts modules, seems that the tiles plugin is never called as the second tiles definition (the one for the module) seems that is never read. Does anyone 'meet' this situation ? How can I solve this? Many thanks, Ionel Condor. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts MVC framework similar to that of a servlet container?
Hi. I've been using Struts for a long time, and I've been very happy with the framework. However, a recent discussion on Sun's Java forums has left me wondering if Struts is necessary. It seems that the servlet container itself provides an MVC framework very similar to that of Struts. All that is missing is some utilities and standardization. I was wondering if there is a flaw in my logic below, and if anyone had any comments. In comparing these two MVC frameworks, the servlet container would be the equivalent of the ActionServlet. They both read their configuration files, examine the incoming URL, and then forward the request to the configured handler. In the case of the servlet container the handlers are Servlet classes, and in the case of Struts its the Action classes. Both the container and the ActionServlet will create an instance of their handler when its requested the first time. The Servlet's service method and the Action's execute method will call some domain logic and then select a view to display to the user. The Servlet can use RequestDispatchers to encapsulate information about the view, and the Action will use an ActionForward. Doesn't this sound very similar? It seems like we are adding a lot of complexity on top of the servlet spec in order to get some common tasks done for us. But that could probably be better done by the servlet container itself. For example, Struts automatically populates the form class the developer specifies for a particular Action. But Sun could provide a standard Filter implementation which does the same thing. You can declare handlers for your exceptions in the Struts configuration file, but you can also do it in the web.xml. If the functionality there is not quite the same, Sun can add a little to the spec and we would get it. My question is, is an application built in Struts really that much more maintainable than one built with servlets? Or if some common utilities provided by the Struts container were provided by the servlet container, would there be much difference? It seems that would even be simpler. Or not? ranko - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 1.1 prepareStatement woes
Dear Joel, You are using some struts API in your class which was implementes (not abstract) in RC2 and become abstract in 1.1 final release. AbstractMethodError will happen only in these scenario. Siva Joel Hainley wrote: I have been trying to get this working for a few hours and am going to beg and plead for help.. 8-) I am getting the error.. java.lang.AbstractMethodError: org.apache.struts.legacy.GenericConnection.prepareStatement(Ljava/lang/Strin g;I)Ljava/sql/PreparedStatement; ...while using the struts 1.1 jar files ( using all of the jar files in the lib directory of the release ) and putting them in the classpath for the build and with Tomcat If I roll back and use struts 1.1-rc1 files ( using all .jar files in the lib directory of the release ), and recompile, and put these jar files in the appropriate directory on tomcat i don't get this error. What am I not doing? I'm sure it's something simple but I can't see it... What do I need to change/use to be able to use the 1.1 version of struts? Thanks, Joel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts MVC framework similar to that of a servlet container?
hi, No doubt, they are vaguely the same. After all STRUTS is based on container. BUT struts make your life EASY. How? By providing scalable and reusable code - base principle of frameworks. 1. Frameworks are the semi-complete applications. They are standardized answer to the very common set of requirements that almost every application faces in it's life cycle. 2. Containers provide some *services* within some *boundaries*. So does STRUTS, but in more refined standardized form. If you see around, there is always some base code. APIs - Base libraries - Facades and so on. Some one writes an encapsulation to make his job easy AND still there is someone who may like to write more encapsulated code. You will definitely find discussions on this list about extending Action class. Why is that? Everyone knows. There are always some set of requirements that occur more frequently and they need to put together as reusable piece of code and that's why STRUTS is here. regards Navjot Singh |-Original Message- |From: Ranko Bijelonic [mailto:[EMAIL PROTECTED] |Sent: Monday, July 21, 2003 12:42 PM |To: [EMAIL PROTECTED] |Subject: Struts MVC framework similar to that of a servlet container? | | | |Hi. I've been using Struts for a long time, and I've been very happy with |the framework. However, a recent discussion on Sun's Java forums has left |me wondering if Struts is necessary. It seems that the servlet container |itself provides an MVC framework very similar to that of Struts. All that |is missing is some utilities and standardization. I was wondering if there |is a flaw in my logic below, and if anyone had any comments. | | |In comparing these two MVC frameworks, the servlet container would be the |equivalent of the ActionServlet. They both read their configuration files, |examine the incoming URL, and then forward the request to the configured |handler. In the case of the servlet container the handlers are Servlet |classes, and in the case of Struts its the Action classes. Both the |container and the ActionServlet will create an instance of their handler |when its requested the first time. The Servlet's service method and the |Action's execute method will call some domain logic and then select a view |to display to the user. The Servlet can use RequestDispatchers to |encapsulate information about the view, and the Action will use an |ActionForward. Doesn't this sound very similar? | |It seems like we are adding a lot of complexity on top of the servlet spec |in order to get some common tasks done for us. But that could probably be |better done by the servlet container itself. For example, Struts |automatically populates the form class the developer specifies for a |particular Action. But Sun could provide a standard Filter implementation |which does the same thing. You can declare handlers for your exceptions in |the Struts configuration file, but you can also do it in the web.xml. If |the functionality there is not quite the same, Sun can add a little to the |spec and we would get it. | |My question is, is an application built in Struts really that much more |maintainable than one built with servlets? Or if some common utilities |provided by the Struts container were provided by the servlet container, |would there be much difference? It seems that would even be simpler. Or |not? | |ranko | | |- |To unsubscribe, e-mail: [EMAIL PROTECTED] |For additional commands, e-mail: [EMAIL PROTECTED] | | - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validator sequence execution
hI, i have something like this my validation.xml field property="cwbPrice" depends="required,float,floatRange,mask" arg0 key="cwbPrice.displayname"/ arg1 name="floatRange" key="${var:min}" resource="false"/ arg2 name="floatRange" key="${var:max}" resource="false"/ msg key="errors.maskTwoDecimals" name="mask"/ var var-namemask/var-name var-value^\d{1}*(.\d{1,2})?$/var-value /var var var-namemin/var-name var-value1.00/var-value /var var var-namemax/var-name var-value99.99/var-value /var /field but the execution order in my jsp is return validateMask(form) validateRequired(form) validateInteger(form) validateFloat(form) validateIntRange(form) validateFloatRange(form); it is validating "mask" at the first place though i have mentioned it in the last. is it the way the validator works or can i mention the sequence elsewhere TIA --nagi Nagendra Kumar O V S Member Technical Staff Ikigo India Private Ltd. 470-B, Road No. 36, Jubilee Hills, Hyderabad 500033 Contact(O): 23544671 Cell: 98482-41789 IncrediMail - Email has finally evolved - Click Here
html:form in a html:logic
Hello, When I try to execute the following Jsp code logic:equal name=responseActionForm property=aBoolean value=true html:form method=post action=/action1.do /logic:equal logic:equal name=responseActionForm property=aBoolean value=false html:form method=post action=/action2.do /logic:equal [...] /html:form i have the following error : [7/21/03 12:28:16:281 CEST] 37d783d WebGroup E SRVE0026E: [Servlet Error]-[/applications/createResponse.jsp#40;98,10#41; Unterminated user-defined tag: ending tag amp;lt#59;/html:formamp;gt#59; not found or incorrectly nested]: org.apache.jasper.compiler.ParseException: /applications/createResponse.jsp(98,10) Unterminated user-defined tag: ending tag lt;/html:formgt; not found or incorrectly nested How can I do the kid of stuff ? Thanks. Cet e-mail et ses annexes (le message) sont strictement confidentiels et peuvent contenir des informations légalement confidentielles. Ce message est établi à l'intention exclusive des personnes ou entités auxquelles il est adressé. Si vous n'êtes pas le destinataire de ce message, toute lecture, copie, diffusion, publication ou toute autre utilisation de ce message est interdite. Merci de nous notifier immédiatement si ce message vous a été adressé par erreur et de le détruire. L'intégrité et la sécurité de ce message ne sont pas garanties, et Euroclear France ne peut être responsable d'altération, d'interception des données ou modification non autorisée. Euroclear est le nom commercial du système Euroclear, Euroclear Plc, Euroclear Bank et ses filiales. This e-mail message, including any attachments transmitted with it, is CONFIDENTIAL and may contain legally privileged information. This message is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient you should not read, copy, distribute, disclose or otherwise use this information. If you have received this message in error, please notify us immediately and delete it from your system. The integrity and security of this message cannot be guaranteed and it may be subject to data corruption, interception and unauthorised amendment, for which we accept no liability. Euroclear is the marketing name for the Euroclear System, Euroclear plc, Euroclear Bank and their affiliates. http://www.euroclear.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems in usage of html:select tag
Hello! I want, that the user can switch the language at runtime and he can chose the language without pressing the submit button. The selection of another item should replace the pressing of the submit button. Can anybody help me? html:form action=/language method = GET html:select property=language html:option value=Deutsch/ html:option value=Englisch/ /html:select html:submit/ -- there are another possibility to mapp the action?? /html:form There are a tutorial how to use the Stuts Tags??? Thank You! Dirk
RE: html:form in a html:logic
Hi, I think it's a pretty straight forward issue. You have given html:form inside inside the logic:equal tags. Now from your perspective the property 'aBoolean' cannot be other than 'true' or 'false'. But for struts there could be a value other than these two for which the html:form tag is not reached at all. So it says not properly used.. The solution would be to put ur /html:form also under logic:equal logic:equal name=responseActionForm property=aBoolean value=true /html:form /logic:equal logic:equal name=responseActionForm property=aBoolean value=false /html:form /logic:equal -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 4:18 PM To: [EMAIL PROTECTED] Subject: html:form in a html:logic Hello, When I try to execute the following Jsp code logic:equal name=responseActionForm property=aBoolean value=true html:form method=post action=/action1.do /logic:equal logic:equal name=responseActionForm property=aBoolean value=false html:form method=post action=/action2.do /logic:equal [...] /html:form i have the following error : [7/21/03 12:28:16:281 CEST] 37d783d WebGroup E SRVE0026E: [Servlet Error]-[/applications/createResponse.jsp#40;98,10#41; Unterminated user-defined tag: ending tag amp;lt#59;/html:formamp;gt#59; not found or incorrectly nested]: org.apache.jasper.compiler.ParseException: /applications/createResponse.jsp(98,10) Unterminated user-defined tag: ending tag lt;/html:formgt; not found or incorrectly nested How can I do the kid of stuff ? Thanks. Cet e-mail et ses annexes (le message) sont strictement confidentiels et peuvent contenir des informations légalement confidentielles. Ce message est établi à l'intention exclusive des personnes ou entités auxquelles il est adressé. Si vous n'êtes pas le destinataire de ce message, toute lecture, copie, diffusion, publication ou toute autre utilisation de ce message est interdite. Merci de nous notifier immédiatement si ce message vous a été adressé par erreur et de le détruire. L'intégrité et la sécurité de ce message ne sont pas garanties, et Euroclear France ne peut être responsable d'altération, d'interception des données ou modification non autorisée. Euroclear est le nom commercial du système Euroclear, Euroclear Plc, Euroclear Bank et ses filiales. This e-mail message, including any attachments transmitted with it, is CONFIDENTIAL and may contain legally privileged information. This message is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient you should not read, copy, distribute, disclose or otherwise use this information. If you have received this message in error, please notify us immediately and delete it from your system. The integrity and security of this message cannot be guaranteed and it may be subject to data corruption, interception and unauthorised amendment, for which we accept no liability. Euroclear is the marketing name for the Euroclear System, Euroclear plc, Euroclear Bank and their affiliates. http://www.euroclear.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:form in a html:logic
This is not a well formed XML document tag1 tag2 /tag1 /tag2 I think is illegal in XML and since custom tags are xml you can not do it. So you will have to do something like: logic:equal name=responseActionForm property=aBoolean value=true html:form method=post action=/action1.do /html:form /logic:equal logic:equal name=responseActionForm property=aBoolean value=false html:form method=post action=/action2.do /html:form /logic:equal if what is in between html:form/html:form is the same for both actions you can always use an include to not replicate the stuff. Alex. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 6:48 AM To: [EMAIL PROTECTED] Subject: html:form in a html:logic Hello, When I try to execute the following Jsp code logic:equal name=responseActionForm property=aBoolean value=true html:form method=post action=/action1.do /logic:equal logic:equal name=responseActionForm property=aBoolean value=false html:form method=post action=/action2.do /logic:equal [...] /html:form i have the following error : [7/21/03 12:28:16:281 CEST] 37d783d WebGroup E SRVE0026E: [Servlet Error]-[/applications/createResponse.jsp#40;98,10#41; Unterminated user-defined tag: ending tag amp;lt#59;/html:formamp;gt#59; not found or incorrectly nested]: org.apache.jasper.compiler.ParseException: /applications/createResponse.jsp(98,10) Unterminated user-defined tag: ending tag lt;/html:formgt; not found or incorrectly nested How can I do the kid of stuff ? Thanks. Cet e-mail et ses annexes (le message) sont strictement confidentiels et peuvent contenir des informations légalement confidentielles. Ce message est établi à l'intention exclusive des personnes ou entités auxquelles il est adressé. Si vous n'êtes pas le destinataire de ce message, toute lecture, copie, diffusion, publication ou toute autre utilisation de ce message est interdite. Merci de nous notifier immédiatement si ce message vous a été adressé par erreur et de le détruire. L'intégrité et la sécurité de ce message ne sont pas garanties, et Euroclear France ne peut être responsable d'altération, d'interception des données ou modification non autorisée. Euroclear est le nom commercial du système Euroclear, Euroclear Plc, Euroclear Bank et ses filiales. This e-mail message, including any attachments transmitted with it, is CONFIDENTIAL and may contain legally privileged information. This message is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient you should not read, copy, distribute, disclose or otherwise use this information. If you have received this message in error, please notify us immediately and delete it from your system. The integrity and security of this message cannot be guaranteed and it may be subject to data corruption, interception and unauthorised amendment, for which we accept no liability. Euroclear is the marketing name for the Euroclear System, Euroclear plc, Euroclear Bank and their affiliates. http://www.euroclear.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems in usage of html:select tag
I had a similar problem. I used javascript to submit the form forcibly in the onchange event of the html:select Swaroop -Original Message- From: Dirk Behrendt [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 4:27 PM To: [EMAIL PROTECTED] Subject: Problems in usage of html:select tag Hello! I want, that the user can switch the language at runtime and he can chose the language without pressing the submit button. The selection of another item should replace the pressing of the submit button. Can anybody help me? html:form action=/language method = GET html:select property=language html:option value=Deutsch/ html:option value=Englisch/ /html:select html:submit/ -- there are another possibility to mapp the action?? /html:form There are a tutorial how to use the Stuts Tags??? Thank You! Dirk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems in usage of html:select tag
html:select property=language html:select property=language onchange=javascript: submit () There are a tutorial how to use the Stuts Tags??? Documentation is included as a war struts-documentation.war There are User guides and API docs for tags. If you do not want to run the war as an app you can just unpack it and browse html. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:form in a html:logic
Yes Alex's argument seems to be valid. I almost forgot about that.. Sorry.. -Original Message- From: Alex Shneyderman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 4:27 PM To: 'Struts Users Mailing List' Subject: RE: html:form in a html:logic This is not a well formed XML document tag1 tag2 /tag1 /tag2 I think is illegal in XML and since custom tags are xml you can not do it. So you will have to do something like: logic:equal name=responseActionForm property=aBoolean value=true html:form method=post action=/action1.do /html:form /logic:equal logic:equal name=responseActionForm property=aBoolean value=false html:form method=post action=/action2.do /html:form /logic:equal if what is in between html:form/html:form is the same for both actions you can always use an include to not replicate the stuff. Alex. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 6:48 AM To: [EMAIL PROTECTED] Subject: html:form in a html:logic Hello, When I try to execute the following Jsp code logic:equal name=responseActionForm property=aBoolean value=true html:form method=post action=/action1.do /logic:equal logic:equal name=responseActionForm property=aBoolean value=false html:form method=post action=/action2.do /logic:equal [...] /html:form i have the following error : [7/21/03 12:28:16:281 CEST] 37d783d WebGroup E SRVE0026E: [Servlet Error]-[/applications/createResponse.jsp#40;98,10#41; Unterminated user-defined tag: ending tag amp;lt#59;/html:formamp;gt#59; not found or incorrectly nested]: org.apache.jasper.compiler.ParseException: /applications/createResponse.jsp(98,10) Unterminated user-defined tag: ending tag lt;/html:formgt; not found or incorrectly nested How can I do the kid of stuff ? Thanks. Cet e-mail et ses annexes (le message) sont strictement confidentiels et peuvent contenir des informations légalement confidentielles. Ce message est établi à l'intention exclusive des personnes ou entités auxquelles il est adressé. Si vous n'êtes pas le destinataire de ce message, toute lecture, copie, diffusion, publication ou toute autre utilisation de ce message est interdite. Merci de nous notifier immédiatement si ce message vous a été adressé par erreur et de le détruire. L'intégrité et la sécurité de ce message ne sont pas garanties, et Euroclear France ne peut être responsable d'altération, d'interception des données ou modification non autorisée. Euroclear est le nom commercial du système Euroclear, Euroclear Plc, Euroclear Bank et ses filiales. This e-mail message, including any attachments transmitted with it, is CONFIDENTIAL and may contain legally privileged information. This message is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient you should not read, copy, distribute, disclose or otherwise use this information. If you have received this message in error, please notify us immediately and delete it from your system. The integrity and security of this message cannot be guaranteed and it may be subject to data corruption, interception and unauthorised amendment, for which we accept no liability. Euroclear is the marketing name for the Euroclear System, Euroclear plc, Euroclear Bank and their affiliates. http://www.euroclear.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
error..!
Dear All, I am new to struts framework, please any body can help me to come out from the following error... Bean Name : Dept.java Action Name:ListDepartmentsAction.java JSP name: DeptListing.jsp -error--- javax.servlet.ServletException: Cannot find bean listdepartments in scope null at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:457) at org.apache.jsp.DeptListing$jsp._jspService(DeptListing$jsp.java:193) 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:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243) 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:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) 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.StandardContext.invoke(StandardContext.java:2344) 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.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462) 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:1011) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106) at java.lang.Thread.run(Thread.java:536) I am facing above error when i run DeptListing.jsp. Hereby I have mentioned code for struts-config.xml DeptListing.jsp , -code for DeptListing.jsp- %@ taglib uri=strutslogic prefix=logic % %@ taglib uri=strutsbean prefix=bean % %@ taglib uri=strutshtml prefix=html % table %System.out.println(Before Calling Me..!);% logic:iterate id=dept property=department name=listdepartments %System.out.println(After Calling Me..!);% tr td bean:write name=dept property=name / /td td html:link page=/listEmployee.do paramId=deptid paramName=dept paramProperty=id Show /html:link /td /tr /logic:iterate /table --end -struts-config.xml- ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.0//EN http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd; struts-config !-- Action Mapping Definitions -- form-beans/form-beans action-mappings action path=/listdepartments type=app.ListDepartmentsAction scope=session validate=false forward name=listing path=/DeptListing.jsp /forward /action /action-mappings !-- message resources
XML To Database
Hello everyone, I have the following problem. I need for my application to use a database which is in form of .xml. I want to convert this database to a real database such us ORACLE. I have a .dtd but I cannot find a way to do this transformation automatically. Can anyone help by giving me some reference docs? I couldn't find anything in the archives. Thank you in advance Konstantina
RE: error..!
Hi , Be careful about case sensitivity issues instead of listdepartments write ListDepartmentsAction Regards Altug. -Original Message- From: virupaksha hosamath [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 2:12 PM To: [EMAIL PROTECTED] Subject: error..! Dear All, I am new to struts framework, please any body can help me to come out from the following error... Bean Name : Dept.java Action Name:ListDepartmentsAction.java JSP name: DeptListing.jsp -error-- - javax.servlet.ServletException: Cannot find bean listdepartments in scope null at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex tImpl.java:457) at org.apache.jsp.DeptListing$jsp._jspService(DeptListing$jsp.java:193) 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(JspServle t.java:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:566) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja va:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:234 4) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :164) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72) 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.ja va:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.j ava:1011) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java: 1106) at java.lang.Thread.run(Thread.java:536) I am facing above error when i run DeptListing.jsp. Hereby I have mentioned code for struts-config.xml DeptListing.jsp , -code for DeptListing.jsp- %@ taglib uri=strutslogic prefix=logic % %@ taglib uri=strutsbean prefix=bean % %@ taglib uri=strutshtml prefix=html % table %System.out.println(Before Calling Me..!);% logic:iterate id=dept property=department name=listdepartments %System.out.println(After Calling Me..!);% tr td bean:write name=dept property=name / /td td html:link page=/listEmployee.do paramId=deptid paramName=dept paramProperty=id Show /html:link /td /tr /logic:iterate /table --end--- - -struts-config.xml-- --- ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.0//EN http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd; struts-config !-- Action Mapping
Re: error..!
put your object in the request attribute ex. % request.setAttribute(listdepartments, listdepartments); % virupaksha hosamath wrote: Dear All, I am new to struts framework, please any body can help me to come out from the following error... Bean Name : Dept.java Action Name:ListDepartmentsAction.java JSP name: DeptListing.jsp -error--- javax.servlet.ServletException: Cannot find bean listdepartments in scope null at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:457) at org.apache.jsp.DeptListing$jsp._jspService(DeptListing$jsp.java:193) 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:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243) 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:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) 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.StandardContext.invoke(StandardContext.java:2344) 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.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462) 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:1011) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106) at java.lang.Thread.run(Thread.java:536) I am facing above error when i run DeptListing.jsp. Hereby I have mentioned code for struts-config.xml DeptListing.jsp , -code for DeptListing.jsp- %@ taglib uri=strutslogic prefix=logic % %@ taglib uri=strutsbean prefix=bean % %@ taglib uri=strutshtml prefix=html % table %System.out.println(Before Calling Me..!);% logic:iterate id=dept property=department name=listdepartments %System.out.println(After Calling Me..!);% tr td bean:write name=dept property=name / /td td html:link page=/listEmployee.do paramId=deptid paramName=dept paramProperty=id Show /html:link /td /tr /logic:iterate /table --end -struts-config.xml- ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.0//EN http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd; struts-config !-- Action Mapping Definitions -- form-beans/form-beans action-mappings action path=/listdepartments
RE: XML To Database
hi, this is off struts but anyway... It's simple. Most of the recent developments in databases now supports XML-DB table mapping. So, it can be transformed automatically. For more details, search for xmldb on otn.oracle.com I have not done this before but as you are working can i expect words on implementation when you will be through? regards Navjot Singh |-Original Message- |From: Konstantina Stamopoulou [mailto:[EMAIL PROTECTED] |Sent: Monday, July 21, 2003 4:45 PM |To: Struts Users Mailing List |Subject: XML To Database | | |Hello everyone, |I have the following problem. I need for my application to use a |database which is in form of .xml. |I want to convert this database to a real database such us ORACLE. | I have a .dtd but I cannot find a way to do this transformation |automatically. |Can anyone help by giving me some reference docs? |I couldn't find anything in the archives. | |Thank you in advance |Konstantina | | | - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: error..!
There is really no code that shows that you actually attached the listdepartments bean to any of the contexts. Where do you do it? If you call your jsp directly then the error above is in deed correct. Before you are ready to display your content you have to set it up first. A good place to do it is in an Action. You can also do it in your JSP but then you would be scriptleting. Alex. -Original Message- From: virupaksha hosamath [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 7:12 AM To: [EMAIL PROTECTED] Subject: error..! Dear All, I am new to struts framework, please any body can help me to come out from the following error... Bean Name : Dept.java Action Name:ListDepartmentsAction.java JSP name: DeptListing.jsp -error-- -- --- javax.servlet.ServletException: Cannot find bean listdepartments in scope null at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex tI mpl.java:457) at org.apache.jsp.DeptListing$jsp._jspService(DeptListing$jsp.java:193) 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(JspServle t. java:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica ti onFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt er Chain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e. java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va :566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e. java:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va :566) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja va :246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va :564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:234 4) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :1 64) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va :566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lv e.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va :564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :1 70) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va :564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va :564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. ja va:163) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va :566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.j av a:1011) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java: 11 06) at java.lang.Thread.run(Thread.java:536) I am facing above error when i run DeptListing.jsp. Hereby I have mentioned code for struts-config.xml DeptListing.jsp , -code for DeptListing.jsp- %@ taglib uri=strutslogic prefix=logic % %@ taglib uri=strutsbean prefix=bean % %@ taglib uri=strutshtml prefix=html % table %System.out.println(Before Calling Me..!);% logic:iterate id=dept property=department name=listdepartments %System.out.println(After Calling Me..!);% tr td bean:write name=dept property=name / /td td html:link page=/listEmployee.do paramId=deptid paramName=dept paramProperty=id Show /html:link /td /tr /logic:iterate /table --end--- --
Re: error..!
Dear Buics, Thanks for ur immediate response.. I tried by putting request.setAttribute(listdeprtments,listdepartments).. please have look on my ListDepartmentAction.java DeptListing.jsp -ListActionDeprtment.java- package app; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; public class ListDepartmentsAction extends Action{ public ActionForward perform(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception{ Dept dept = new Dept(); request.setAttribute(listdepartments,dept.getDepartments()); return mapping.findForward(listing); } } end -DeptListing.jsp--- %@ taglib uri=strutslogic prefix=logic % %@ taglib uri=strutsbean prefix=bean % %@ taglib uri=strutshtml prefix=html % table % request.getAttribute(listdepartments); % logic:iterate id=dept property=department name=listdepartments tr td bean:write name=dept property=name / /td td html:link page=/listEmployee.do paramId=deptid paramName=dept paramProperty=id Show /html:link /td /tr /logic:iterate /table -- Buics wrote: put your object in the request attribute ex. request.setAttribute(listdepartments, listdepartments); % virupaksha hosamath wrote: Dear All, I am new to struts framework, please any body can help me to come out from the following error... Bean Name : Dept.java Action Name:ListDepartmentsAction.java JSP name: DeptListing.jsp -error--- javax.servlet.ServletException: Cannot find bean listdepartments in scope null at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:457) at org.apache.jsp.DeptListing$jsp._jspService(DeptListing$jsp.java:193) 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:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243) 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:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) 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.StandardContext.invoke(StandardContext.java:2344) 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.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462) 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
RE: error..!
Although u have listed down the errors its not clear what exactly you want to do.. I assume that u want to iterate over a collection of departments and print the name of the department. So here it goes logic:iterate property -Name of the property whose getter method returns the collection to be iterated name - name of the JSP bean, the getter method whose property getter returns the collection to be iterated So essentially 'property' will be your department name collection(Im not too sure whether this is listdepartments) and 'name' should be your ActionForm bean. However I cannot find that in your struts-config. Wondering how are you getting the listDepartments in the request. You should either have the form bean set in the struts-config or should be setting a listDepartments to the request. request.getSession().setAttribute(CommonConstants.DTO_IN_SESSION, listDepartments); I just used one of the codes which I am using inside my Action class where I don't have the actionForm bean. Swaroop -Original Message- From: virupaksha hosamath [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 4:42 PM To: [EMAIL PROTECTED] Subject: error..! Dear All, I am new to struts framework, please any body can help me to come out from the following error... Bean Name : Dept.java Action Name:ListDepartmentsAction.java JSP name: DeptListing.jsp -error-- - javax.servlet.ServletException: Cannot find bean listdepartments in scope null at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex tImpl.java:457) at org.apache.jsp.DeptListing$jsp._jspService(DeptListing$jsp.java:193) 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(JspServle t.java:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:566) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja va:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:234 4) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :164) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72) 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.ja va:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.j ava:1011) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java: 1106) at java.lang.Thread.run(Thread.java:536) I am facing above error when i run DeptListing.jsp. Hereby I have mentioned code for struts-config.xml DeptListing.jsp , -code for DeptListing.jsp- %@ taglib uri=strutslogic prefix=logic % %@ taglib uri=strutsbean prefix=bean % %@
RE: html:form in a html:logic
Because the tag body is interpreted in its entirety, you have to end the html:form within the logic:equal, not outside it. Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 6:48 AM To: [EMAIL PROTECTED] Subject: html:form in a html:logic Hello, When I try to execute the following Jsp code logic:equal name=responseActionForm property=aBoolean value=true html:form method=post action=/action1.do /logic:equal logic:equal name=responseActionForm property=aBoolean value=false html:form method=post action=/action2.do /logic:equal [...] /html:form i have the following error : [7/21/03 12:28:16:281 CEST] 37d783d WebGroup E SRVE0026E: [Servlet Error]-[/applications/createResponse.jsp#40;98,10#41; Unterminated user-defined tag: ending tag amp;lt#59;/html:formamp;gt#59; not found or incorrectly nested]: org.apache.jasper.compiler.ParseException: /applications/createResponse.jsp(98,10) Unterminated user-defined tag: ending tag lt;/html:formgt; not found or incorrectly nested How can I do the kid of stuff ? Thanks. Cet e-mail et ses annexes (le message) sont strictement confidentiels et peuvent contenir des informations légalement confidentielles. Ce message est établi à l'intention exclusive des personnes ou entités auxquelles il est adressé. Si vous n'êtes pas le destinataire de ce message, toute lecture, copie, diffusion, publication ou toute autre utilisation de ce message est interdite. Merci de nous notifier immédiatement si ce message vous a été adressé par erreur et de le détruire. L'intégrité et la sécurité de ce message ne sont pas garanties, et Euroclear France ne peut être responsable d'altération, d'interception des données ou modification non autorisée. Euroclear est le nom commercial du système Euroclear, Euroclear Plc, Euroclear Bank et ses filiales. This e-mail message, including any attachments transmitted with it, is CONFIDENTIAL and may contain legally privileged information. This message is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient you should not read, copy, distribute, disclose or otherwise use this information. If you have received this message in error, please notify us immediately and delete it from your system. The integrity and security of this message cannot be guaranteed and it may be subject to data corruption, interception and unauthorised amendment, for which we accept no liability. Euroclear is the marketing name for the Euroclear System, Euroclear plc, Euroclear Bank and their affiliates. http://www.euroclear.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Réf. : RE: html:form in a html:logic
thanks Alex. I should have thought about it sooner. Everything is allright now. bruno. Alex Shneyderman Pour : 'Struts Users Mailing List' [EMAIL PROTECTED] [EMAIL PROTECTED]cc : umbia.edu Objet : RE: html:form in a html:logic 21/07/2003 12:57 Veuillez répondre à Struts Users Mailing List This is not a well formed XML document tag1 tag2 /tag1 /tag2 I think is illegal in XML and since custom tags are xml you can not do it. So you will have to do something like: logic:equal name=responseActionForm property=aBoolean value=true html:form method=post action=/action1.do /html:form /logic:equal logic:equal name=responseActionForm property=aBoolean value=false html:form method=post action=/action2.do /html:form /logic:equal if what is in between html:form/html:form is the same for both actions you can always use an include to not replicate the stuff. Alex. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 6:48 AM To: [EMAIL PROTECTED] Subject: html:form in a html:logic Hello, When I try to execute the following Jsp code logic:equal name=responseActionForm property=aBoolean value=true html:form method=post action=/action1.do /logic:equal logic:equal name=responseActionForm property=aBoolean value=false html:form method=post action=/action2.do /logic:equal [...] /html:form i have the following error : [7/21/03 12:28:16:281 CEST] 37d783d WebGroup E SRVE0026E: [Servlet Error]-[/applications/createResponse.jsp#40;98,10#41; Unterminated user-defined tag: ending tag amp;lt#59;/html:formamp;gt#59; not found or incorrectly nested]: org.apache.jasper.compiler.ParseException: /applications/createResponse.jsp(98,10) Unterminated user-defined tag: ending tag lt;/html:formgt; not found or incorrectly nested How can I do the kid of stuff ? Thanks. Cet e-mail et ses annexes (le message) sont strictement confidentiels et peuvent contenir des informations légalement confidentielles. Ce message est établi à l'intention exclusive des personnes ou entités auxquelles il est adressé. Si vous n'êtes pas le destinataire de ce message, toute lecture, copie, diffusion, publication ou toute autre utilisation de ce message est interdite. Merci de nous notifier immédiatement si ce message vous a été adressé par erreur et de le détruire. L'intégrité et la sécurité de ce message ne sont pas garanties, et Euroclear France ne peut être responsable d'altération, d'interception des données ou modification non autorisée. Euroclear est le nom commercial du système Euroclear, Euroclear Plc, Euroclear Bank et ses filiales. This e-mail message, including any attachments transmitted with it, is CONFIDENTIAL and may contain legally privileged information. This message is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient you should not read, copy, distribute, disclose or otherwise use this information. If you have received this message in error, please notify us immediately and delete it from your system. The integrity and security of this message cannot be guaranteed and it may be subject to data corruption, interception and unauthorised amendment, for which we accept no liability. Euroclear is the marketing name for the Euroclear System, Euroclear plc, Euroclear Bank and their affiliates. http://www.euroclear.com - To unsubscribe, e-mail: [EMAIL
Re: Struts MVC framework similar to that of a servlet container?
there's a lot of stuff it gives you out of the box. 1. solid code 2. validation framework 3. tile framework 4. auto-population framework 5. role based actions 6. xml configuration of all the links or actions of your application 7. best practices framework bundling (scaffolding) complete with examples (many years of experience went into this one). 8. ease of use I am missing about twice as many things from this list I am sure... the servlet container is sun's way of making sure that what you build is timeless (and works on their servers...) Struts solves common problems across every typical application. The servlet container does not solve these typical problems. Struts is really a pattern... sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: Hi. I've been using Struts for a long time, and I've been very happy with the framework. However, a recent discussion on Sun's Java forums has left me wondering if Struts is necessary. It seems that the servlet container itself provides an MVC framework very similar to that of Struts. All that is missing is some utilities and standardization. I was wondering if there is a flaw in my logic below, and if anyone had any comments. In comparing these two MVC frameworks, the servlet container would be the equivalent of the ActionServlet. They both read their configuration files, examine the incoming URL, and then forward the request to the configured handler. In the case of the servlet container the handlers are Servlet classes, and in the case of Struts its the Action classes. Both the container and the ActionServlet will create an instance of their handler when its requested the first time. The Servlet's service method and the Action's execute method will call some domain logic and then select a view to display to the user. The Servlet can use RequestDispatchers to encapsulate information about the view, and the Action will use an ActionForward. Doesn't this sound very similar? It seems like we are adding a lot of complexity on top of the servlet spec in order to get some common tasks done for us. But that could probably be better done by the servlet container itself. For example, Struts automatically populates the form class the developer specifies for a particular Action. But Sun could provide a standard Filter implementation which does the same thing. You can declare handlers for your exceptions in the Struts configuration file, but you can also do it in the web.xml. If the functionality there is not quite the same, Sun can add a little to the spec and we would get it. My question is, is an application built in Struts really that much more maintainable than one built with servlets? Or if some common utilities provided by the Struts container were provided by the servlet container, would there be much difference? It seems that would even be simpler. Or not? ranko - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts MVC framework similar to that of a servletcontainer?
Sandeep, You mentioned role based actions in your list... which has caught my eye. Can you please elaborate on this ? Or point me to some documentation ? thanks -raj Sandeep Takhar [EMAIL PROTECTED]To: Struts Users Mailing List [EMAIL PROTECTED] ahoo.comcc: Subject: Re: Struts MVC framework similar to that of a servlet container? 21/07/2003 06:08 PM Please respond to Struts Users Mailing List there's a lot of stuff it gives you out of the box. 1. solid code 2. validation framework 3. tile framework 4. auto-population framework 5. role based actions 6. xml configuration of all the links or actions of your application 7. best practices framework bundling (scaffolding) complete with examples (many years of experience went into this one). 8. ease of use I am missing about twice as many things from this list I am sure... the servlet container is sun's way of making sure that what you build is timeless (and works on their servers...) Struts solves common problems across every typical application. The servlet container does not solve these typical problems. Struts is really a pattern... sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: Hi. I've been using Struts for a long time, and I've been very happy with the framework. However, a recent discussion on Sun's Java forums has left me wondering if Struts is necessary. It seems that the servlet container itself provides an MVC framework very similar to that of Struts. All that is missing is some utilities and standardization. I was wondering if there is a flaw in my logic below, and if anyone had any comments. In comparing these two MVC frameworks, the servlet container would be the equivalent of the ActionServlet. They both read their configuration files, examine the incoming URL, and then forward the request to the configured handler. In the case of the servlet container the handlers are Servlet classes, and in the case of Struts its the Action classes. Both the container and the ActionServlet will create an instance of their handler when its requested the first time. The Servlet's service method and the Action's execute method will call some domain logic and then select a view to display to the user. The Servlet can use RequestDispatchers to encapsulate information about the view, and the Action will use an ActionForward. Doesn't this sound very similar? It seems like we are adding a lot of complexity on top of the servlet spec in order to get some common tasks done for us. But that could probably be better done by the servlet container itself. For example, Struts automatically populates the form class the developer specifies for a particular Action. But Sun could provide a standard Filter implementation which does the same thing. You can declare handlers for your exceptions in the Struts configuration file, but you can also do it in the web.xml. If the functionality there is not quite the same, Sun can add a little to the spec and we would get it. My question is, is an application built in Struts really that much more maintainable than one built with servlets? Or if some common utilities provided by the Struts container were provided by the servlet container, would there be much difference? It seems that would even be simpler. Or not? ranko - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95
RE: FW: Redirect to home page on logon
Thanks Rick. I did something similar to that and it works. But, behind the scenes, still execution is forwarded to the error page. Of course the filter intercepts that and corrects things. But I still can't understand the error that occurs. I wrote that in a later post, don't know if you've seen it. -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED] Sent: Sunday, July 20, 2003 3:25 PM To: Struts Users Mailing List Subject: Re: FW: Redirect to home page on logon On Sun, Jul 20,'03 (01:44 PM GMT+0300), Tarek wrote: I have an application that uses beans stored in the session context. If the user's session times out, he's asked to re-login on his next request. For this, I'm using J2EE security; I'm not doing it myself.After the user is finished with the re-login, he's supposed to complete his request, but the fact that the beans are not in the session anymore produces an error.Unfortunately, those beans are specific to the last request the user made, so I cannot re-initialize them in a listener for session creation. I was wondering if there's a way to configure security so that after the user logs in he's redirected to a certain page instead of being able to continue his last request. I had the same problem.. here's what I do... I use the servlet filter to authenticate roles and to bring me back to the login if the role isn't set. To fix the problem with the Session variables not being set I have ALL of my actions (which are dispatch actions) extend a BaseDispatchAction. In this BaseDispatchAction I do the check for a User bean being in Session scope in the BaseDispatchAction execute method. If the bean is there, all is well, and continue onward. If it is not it fowards the user to a SetUpAction which in turn will forward them to the main page after the setup is complete. (Of course if you want you could forward them back to what page they were trying to go to if you app flow will allow it.. in my case it was necessary to just always return them to the default home page after login. The execute method in the BaseDispatchAction looks like: HttpSession session = request.getSession(); if ( session == null || (UserBean)session.getAttribute(userBean) == null) { //foward user to the SetUpAction or page of your choice return mapping.findForward(Const.SETUPF);} else { //all ok so proceed to doing standard dispatch action return super.execute(mapping, form, request, response); } -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts MVC framework similar to that of a servlet container?
http://jakarta.apache.org/struts/userGuide/building_controller.html 4.8 4.21 sandeep --- [EMAIL PROTECTED] wrote: Sandeep, You mentioned role based actions in your list... which has caught my eye. Can you please elaborate on this ? Or point me to some documentation ? thanks -raj Sandeep Takhar [EMAIL PROTECTED]To: Struts Users Mailing List [EMAIL PROTECTED] ahoo.comcc: Subject: Re: Struts MVC framework similar to that of a servlet container? 21/07/2003 06:08 PM Please respond to Struts Users Mailing List there's a lot of stuff it gives you out of the box. 1. solid code 2. validation framework 3. tile framework 4. auto-population framework 5. role based actions 6. xml configuration of all the links or actions of your application 7. best practices framework bundling (scaffolding) complete with examples (many years of experience went into this one). 8. ease of use I am missing about twice as many things from this list I am sure... the servlet container is sun's way of making sure that what you build is timeless (and works on their servers...) Struts solves common problems across every typical application. The servlet container does not solve these typical problems. Struts is really a pattern... sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: Hi. I've been using Struts for a long time, and I've been very happy with the framework. However, a recent discussion on Sun's Java forums has left me wondering if Struts is necessary. It seems that the servlet container itself provides an MVC framework very similar to that of Struts. All that is missing is some utilities and standardization. I was wondering if there is a flaw in my logic below, and if anyone had any comments. In comparing these two MVC frameworks, the servlet container would be the equivalent of the ActionServlet. They both read their configuration files, examine the incoming URL, and then forward the request to the configured handler. In the case of the servlet container the handlers are Servlet classes, and in the case of Struts its the Action classes. Both the container and the ActionServlet will create an instance of their handler when its requested the first time. The Servlet's service method and the Action's execute method will call some domain logic and then select a view to display to the user. The Servlet can use RequestDispatchers to encapsulate information about the view, and the Action will use an ActionForward. Doesn't this sound very similar? It seems like we are adding a lot of complexity on top of the servlet spec in order to get some common tasks done for us. But that could probably be better done by the servlet container itself. For example, Struts automatically populates the form class the developer specifies for a particular Action. But Sun could provide a standard Filter implementation which does the same thing. You can declare handlers for your exceptions in the Struts configuration file, but you can also do it in the web.xml. If the functionality there is not quite the same, Sun can add a little to the spec and we would get it. My question is, is an application built in Struts really that much more maintainable than one built with servlets? Or if some common utilities provided by the Struts container were provided by the servlet container, would there be much difference? It seems that would even be simpler. Or not?
RE: Struts MVC framework similar to that of a servlet container?
I understand the point of frameworks, I was just wondering if the one Struts aims to provide one that is already largely provided by the container. -Original Message- From: Navjot Singh [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 4:14 AM To: Struts Users Mailing List Subject: RE: Struts MVC framework similar to that of a servlet container? hi, No doubt, they are vaguely the same. After all STRUTS is based on container. BUT struts make your life EASY. How? By providing scalable and reusable code - base principle of frameworks. 1. Frameworks are the semi-complete applications. They are standardized answer to the very common set of requirements that almost every application faces in it's life cycle. 2. Containers provide some *services* within some *boundaries*. So does STRUTS, but in more refined standardized form. If you see around, there is always some base code. APIs - Base libraries - Facades and so on. Some one writes an encapsulation to make his job easy AND still there is someone who may like to write more encapsulated code. You will definitely find discussions on this list about extending Action class. Why is that? Everyone knows. There are always some set of requirements that occur more frequently and they need to put together as reusable piece of code and that's why STRUTS is here. regards Navjot Singh |-Original Message- |From: Ranko Bijelonic [mailto:[EMAIL PROTECTED] |Sent: Monday, July 21, 2003 12:42 PM |To: [EMAIL PROTECTED] |Subject: Struts MVC framework similar to that of a servlet container? | | | |Hi. I've been using Struts for a long time, and I've been very happy with |the framework. However, a recent discussion on Sun's Java forums has left |me wondering if Struts is necessary. It seems that the servlet container |itself provides an MVC framework very similar to that of Struts. All that |is missing is some utilities and standardization. I was wondering if there |is a flaw in my logic below, and if anyone had any comments. | | |In comparing these two MVC frameworks, the servlet container would be the |equivalent of the ActionServlet. They both read their configuration files, |examine the incoming URL, and then forward the request to the configured |handler. In the case of the servlet container the handlers are Servlet |classes, and in the case of Struts its the Action classes. Both the |container and the ActionServlet will create an instance of their handler |when its requested the first time. The Servlet's service method and the |Action's execute method will call some domain logic and then select a view |to display to the user. The Servlet can use RequestDispatchers to |encapsulate information about the view, and the Action will use an |ActionForward. Doesn't this sound very similar? | |It seems like we are adding a lot of complexity on top of the servlet spec |in order to get some common tasks done for us. But that could probably be |better done by the servlet container itself. For example, Struts |automatically populates the form class the developer specifies for a |particular Action. But Sun could provide a standard Filter implementation |which does the same thing. You can declare handlers for your exceptions in |the Struts configuration file, but you can also do it in the web.xml. If |the functionality there is not quite the same, Sun can add a little to the |spec and we would get it. | |My question is, is an application built in Struts really that much more |maintainable than one built with servlets? Or if some common utilities |provided by the Struts container were provided by the servlet container, |would there be much difference? It seems that would even be simpler. Or |not? | |ranko | | |- |To unsubscribe, e-mail: [EMAIL PROTECTED] |For additional commands, e-mail: [EMAIL PROTECTED] | | - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts MVC framework similar to that of a servlet container?
there's a lot of stuff it gives you out of the box. 1. solid code so does the container i guess. 2. validation framework This is one of those changes that could be added by way of utility classes. Have that Filter that autopopulates, check for correct types like Struts. 3. tile framework You can use it without Struts 4. auto-population framework It should be easy to add a Filter that autopopulates a configured form (not every time but as a standard). 5. role based actions I'm not sure what this is. 6. xml configuration of all the links or actions of your application So does web.xml i guess. 7. best practices framework bundling (scaffolding) complete with examples (many years of experience went into this one). Same thing as above. There are tutorials, examples, etc... 8. ease of use If you think of a Servlet as an Action its kind of as easy. Except for some repetative tasks that I would include to complete the servlet spec (rather than rewrite some of the container functionality to add those utils). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 8:42 AM To: Struts Users Mailing List Subject: Re: Struts MVC framework similar to that of a servlet container? Sandeep, You mentioned role based actions in your list... which has caught my eye. Can you please elaborate on this ? Or point me to some documentation ? thanks -raj Sandeep Takhar [EMAIL PROTECTED]To: Struts Users Mailing List [EMAIL PROTECTED] ahoo.comcc: Subject: Re: Struts MVC framework similar to that of a servlet container? 21/07/2003 06:08 PM Please respond to Struts Users Mailing List there's a lot of stuff it gives you out of the box. 1. solid code 2. validation framework 3. tile framework 4. auto-population framework 5. role based actions 6. xml configuration of all the links or actions of your application 7. best practices framework bundling (scaffolding) complete with examples (many years of experience went into this one). 8. ease of use I am missing about twice as many things from this list I am sure... the servlet container is sun's way of making sure that what you build is timeless (and works on their servers...) Struts solves common problems across every typical application. The servlet container does not solve these typical problems. Struts is really a pattern... sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: Hi. I've been using Struts for a long time, and I've been very happy with the framework. However, a recent discussion on Sun's Java forums has left me wondering if Struts is necessary. It seems that the servlet container itself provides an MVC framework very similar to that of Struts. All that is missing is some utilities and standardization. I was wondering if there is a flaw in my logic below, and if anyone had any comments. In comparing these two MVC frameworks, the servlet container would be the equivalent of the ActionServlet. They both read their configuration files, examine the incoming URL, and then forward the request to the configured handler. In the case of the servlet container the handlers are Servlet classes, and in the case of Struts its the Action classes. Both the container and the ActionServlet will create an instance of their handler when its requested the first time. The Servlet's service method and the Action's execute method will call some domain logic and then select a view to display to the user. The Servlet can use RequestDispatchers to encapsulate information about the view, and the Action will use an ActionForward. Doesn't this sound very similar? It seems like we are adding a lot of complexity on top of the servlet spec in order to get some common tasks done for us. But that could probably be better done by the servlet container itself. For example, Struts automatically populates the form class the developer specifies for a particular Action. But Sun could provide a standard Filter implementation which does the same thing. You can declare handlers for your exceptions in the Struts configuration file, but you can also do it in the web.xml. If the functionality there is not quite the same, Sun can add a little to the spec and we would get it. My question is, is an application built in Struts really that much more maintainable than one built with servlets? Or if some common utilities provided by the Struts container were provided by the servlet container, would there be much difference? It seems that would even be simpler. Or not? ranko - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,
RE: Struts MVC framework similar to that of a servlet container?
hi ranko, Assume you don't use struts. You start writing your first app for your requirements. Being an expert programmer, you have done with first one by wriitng lots of utility classes and base code. Now you start with second. You will realize that the second app can use most of the functionality (except business logic) from the first app. NOW WHAT? You will dig out some code from first app that can be RE-USED in second app. That code can be called a framework(;et's call it RANKo framework ;-) and that's precisely what STRUTS intends to provide. Anyway, it's your viewpoint. Being a creator of one servlet/xml/xslt based framework myself(almost 18 months back), I know what is *common code* required for *most of the apps* and the efforts/time needed to create that framework. So, when starting with an app, i can find and USE as good framework as STRUTS, nothing like that. I don't say STRUTS is good enough, you may have diff requirements altogether so struts may not be the best choice for you. You write on your own but it's always good to look around for good frameworks and build ON TOP OF THEM. hope it clears. still i am trying to give answers to few of the individual points below. -navjot | 1. solid code |so does the container i guess. true but container gives you world of choice. Struts gives you the base code for *common* requirements. So, you save time writing on *that common* code. |2. validation framework |This is one of those changes that could be added by way of utility classes. |Have that Filter that autopopulates, check for correct types like Struts. Agreed. |3. tile framework |You can use it without Struts Struts also does not enforce any fix presentation model. Could be xslt/velocity/jsp any. | 4. auto-population framework |It should be easy to add a Filter that autopopulates a configured form (not |every time but as a standard). | | 5. role based actions |I'm not sure what this is. Same as roles in servlet specs but checking is deferred per action. |6. xml configuration of all the links or actions of |your application So does web.xml i guess. but here it is module based config. easy of maintenance ;-) |7. best practices framework bundling (scaffolding)complete with examples (many years of experience went |into this one). |Same thing as above. There are tutorials, examples, etc... | | | 8. ease of use |If you think of a Servlet as an Action its kind of as easy. |Except for some |repetative tasks that I would include to complete the servlet spec (rather |than rewrite some of the container functionality to add those utils). | |-Original Message- |From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] |Sent: Monday, July 21, 2003 8:42 AM |To: Struts Users Mailing List |Subject: Re: Struts MVC framework similar to that of a servlet |container? | | | |Sandeep, |You mentioned role based actions in your list... which has caught my eye. |Can you please elaborate on this ? Or point me to some documentation ? | |thanks |-raj | | | | | Sandeep Takhar | [EMAIL PROTECTED]To: Struts Users |Mailing List [EMAIL PROTECTED] | ahoo.comcc: | Subject: Re: Struts MVC |framework similar to that of a servlet container? | 21/07/2003 06:08 | PM | Please respond to | Struts Users | Mailing List | | | | | | |there's a lot of stuff it gives you out of the box. | |1. solid code |2. validation framework |3. tile framework |4. auto-population framework |5. role based actions |6. xml configuration of all the links or actions of |your application |7. best practices framework bundling (scaffolding) |complete with examples (many years of experience went |into this one). |8. ease of use | |I am missing about twice as many things from this list |I am sure... | |the servlet container is sun's way of making sure that |what you build is timeless (and works on their |servers...) | |Struts solves common problems across every typical |application. The servlet container does not solve |these typical problems. Struts is really a pattern... | |sandeep |--- Ranko Bijelonic [EMAIL PROTECTED] wrote: | | Hi. I've been using Struts for a long time, and | I've been very happy with | the framework. However, a recent discussion on | Sun's Java forums has left | me wondering if Struts is necessary. It seems that | the servlet container | itself provides an MVC framework very similar to | that of Struts. All that | is missing is some utilities and standardization. I | was wondering if there | is a flaw in my logic below, and if anyone had any | comments. | | | In comparing these two MVC frameworks, the servlet | container would be the | equivalent of the ActionServlet. They both read | their configuration files, | examine the incoming URL, and then forward the | request to the
clicking a hyperlink to populate a field
Hi all, This is what I want to do: A user will enter part of a school name in one field on an ActionForm and part of a school address on in another field on the same form. The user then clicks on a find school button which opens a new page and lists a collection of matching candidate schools by doing an SQL SELECT query based on what the user has entered on the previous ActionForm. I want the school name to be a hyperlink so that the user clicks on the matching school name in order to populate the school name and address fields on the previous ActionForm. I want to know if this is possible in Struts, is there a Tag that will allow me to do this? Thanks in advance yan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
getting an ActionMapping class from within a custom tag
Hi, What: I would like to find the roles associated with an ActionMapping from within a custom tag, but I only have the action name so I guess I need to get an instance of the ActionMapping class. How can I do this? How do I get an ActionMapping class, given the name of the action? Why: I want a generalized way to hide links to actions that the currently logged-in user doesn't have access to. So what I plan to do is subclass the html:link tag-- my subclass will check the current user's access to the action for the specified link, and either hide it, or print only the link text. Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Setting a cookie
Hi all How do I go about setting a cookie via Struts? I've tried this within the perform() of an Action, and it doesn't seem to work: Cookie cookie = null; cookie = new Cookie(u, LoginForm.getUsername()); response.addCookie(cookie); cookie = new Cookie(p, LoginForm.getPassword()); response.addCookie(cookie); cookie = new Cookie(g, LoginForm.getGroup()); response.addCookie(cookie); return mapping.findForward(forward); Any help would be appreciated, bort - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: clicking a hyperlink to populate a field
This is possible. Put the original form into Session scope so that you don't lose the data the user enters prior to using the 'Find School' button. Each match could be a hyperlink to a UseSchoolAction, passing the ID of the school to use as a parameter. The UseSchoolAction could then set the relevant details for the chosen school on the original form. Comments? Paul -Original Message- From: yan [mailto:[EMAIL PROTECTED] Sent: 21 July 2003 15:41 To: [EMAIL PROTECTED] Subject: clicking a hyperlink to populate a field Hi all, This is what I want to do: A user will enter part of a school name in one field on an ActionForm and part of a school address on in another field on the same form. The user then clicks on a find school button which opens a new page and lists a collection of matching candidate schools by doing an SQL SELECT query based on what the user has entered on the previous ActionForm. I want the school name to be a hyperlink so that the user clicks on the matching school name in order to populate the school name and address fields on the previous ActionForm. I want to know if this is possible in Struts, is there a Tag that will allow me to do this? Thanks in advance yan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: clicking a hyperlink to populate a field
Sure, this is what I do. An easy way: Use Javascript. When you pop up the window and user finds his/her school you need to put the following code in your link onclick event: Javascript: parent.document.form ['formname'].schoolField.value='Whatever the name of your school'; window.close (); return false; - or something like that I can't remember my JS stuff exactly but you get the idea. You can probably evenrwrite a function for this since you might need to set more than one field (schoolId probably, school location etc.) Now the parent window is supposed to have the form and schoolField is text that is disabled and there is a button next to it that actually pops up your popup window, to allow your user to select the school. A more complicated way would be to forget about pop ups and keep track in the session of where the user at in the process of selection the school. Once request comes that you can be happy with (school is selected) you just shoot the first form back. The advantage of this method is that you do not rely on JavaScript. Disadvantage is that your logic becomes more complicated, as your request might spawn more than one form. Alex. -Original Message- From: yan [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:41 AM To: [EMAIL PROTECTED] Subject: clicking a hyperlink to populate a field Hi all, This is what I want to do: A user will enter part of a school name in one field on an ActionForm and part of a school address on in another field on the same form. The user then clicks on a find school button which opens a new page and lists a collection of matching candidate schools by doing an SQL SELECT query based on what the user has entered on the previous ActionForm. I want the school name to be a hyperlink so that the user clicks on the matching school name in order to populate the school name and address fields on the previous ActionForm. I want to know if this is possible in Struts, is there a Tag that will allow me to do this? Thanks in advance yan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: clicking a hyperlink to populate a field
The parent window would have to be refreshed though for the selected value to show up on the parent form On how to do this here is a link http://forums.devshed.com/archive/1/2002/11/2/46942 I am sure there are other resourcesgoogle it! -Original Message- From: Paul McCulloch [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 9:54 AM To: 'Struts Users Mailing List' Subject: RE: clicking a hyperlink to populate a field This is possible. Put the original form into Session scope so that you don't lose the data the user enters prior to using the 'Find School' button. Each match could be a hyperlink to a UseSchoolAction, passing the ID of the school to use as a parameter. The UseSchoolAction could then set the relevant details for the chosen school on the original form. Comments? Paul -Original Message- From: yan [mailto:[EMAIL PROTECTED] Sent: 21 July 2003 15:41 To: [EMAIL PROTECTED] Subject: clicking a hyperlink to populate a field Hi all, This is what I want to do: A user will enter part of a school name in one field on an ActionForm and part of a school address on in another field on the same form. The user then clicks on a find school button which opens a new page and lists a collection of matching candidate schools by doing an SQL SELECT query based on what the user has entered on the previous ActionForm. I want the school name to be a hyperlink so that the user clicks on the matching school name in order to populate the school name and address fields on the previous ActionForm. I want to know if this is possible in Struts, is there a Tag that will allow me to do this? Thanks in advance yan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: getting an ActionMapping class from within a custom tag
-Original Message- From: p [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:46 AM To: [EMAIL PROTECTED] Subject: getting an ActionMapping class from within a custom tag Hi, What: I would like to find the roles associated with an ActionMapping from within a custom tag, but I only have the action name so I guess I need to get an instance of the ActionMapping class. How can I do this? How do I get an ActionMapping class, given the name of the action? ModuleConfig mc = RequestUtils.getRequestModuleConfig (request); ActionMapping am = (ActionMapping) mc.findActionConfig (actionName); Why: I want a generalized way to hide links to actions that the currently logged-in user doesn't have access to. So what I plan to do is subclass the html:link tag-- my subclass will check the current user's access to the action for the specified link, and either hide it, or print only the link text. You can do it easier with tiles I think. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: clicking a hyperlink to populate a field
I was going on the basis of only a single browser window being open. The one window shows the initial form, then the search, then back to the original form. -Original Message- From: Amit Kirdatt [mailto:[EMAIL PROTECTED] Sent: 21 July 2003 15:58 To: 'Struts Users Mailing List' Subject: RE: clicking a hyperlink to populate a field The parent window would have to be refreshed though for the selected value to show up on the parent form On how to do this here is a link http://forums.devshed.com/archive/1/2002/11/2/46942 I am sure there are other resourcesgoogle it! -Original Message- From: Paul McCulloch [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 9:54 AM To: 'Struts Users Mailing List' Subject: RE: clicking a hyperlink to populate a field This is possible. Put the original form into Session scope so that you don't lose the data the user enters prior to using the 'Find School' button. Each match could be a hyperlink to a UseSchoolAction, passing the ID of the school to use as a parameter. The UseSchoolAction could then set the relevant details for the chosen school on the original form. Comments? Paul -Original Message- From: yan [mailto:[EMAIL PROTECTED] Sent: 21 July 2003 15:41 To: [EMAIL PROTECTED] Subject: clicking a hyperlink to populate a field Hi all, This is what I want to do: A user will enter part of a school name in one field on an ActionForm and part of a school address on in another field on the same form. The user then clicks on a find school button which opens a new page and lists a collection of matching candidate schools by doing an SQL SELECT query based on what the user has entered on the previous ActionForm. I want the school name to be a hyperlink so that the user clicks on the matching school name in order to populate the school name and address fields on the previous ActionForm. I want to know if this is possible in Struts, is there a Tag that will allow me to do this? Thanks in advance yan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using the validator for client side field modifications
Hi. I've been reading through some of the documentation and I haven't found exactly what I'm looking for. I'm sure (famous last words) that this is possible, but I need confirmation for a presentation I'm making. I have a form with text fields that I need to convert to upper case, verify they contain only numbers, etc., but I need to do it real time, i.e. using onBlur (this is due to the fact that I am converting an existing application and need similar functionality). The users want to see the fields converted and checked when they tab/click out of the fields. I have been reading about the validator and the validator:javascript formname=myForm / onSubmit=validateMyForm tag combo, but I'm not sure it does what I want as it seems to be doing a *form* validation. Could someone point me in the correct direction? My goal is to consolidate all the javascript into the validator.xml file so I can reference it by name. Should I just be using a simple javascript include instead? Thanks, /greg -- Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts MVC framework similar to that of a servlet container?
I guess the main difference between what you mention and struts is that you can use this stuff right away for the app you want to build without modification. As long as you understand the concepts you can apply them. Similar to how you understand a servlet/filter spec. Now you have common problems solved. You don't have to code them or copy and paste from somewhere. You also have the ability to auto-populate to lists which is pretty neat. sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: there's a lot of stuff it gives you out of the box. 1. solid code so does the container i guess. 2. validation framework This is one of those changes that could be added by way of utility classes. Have that Filter that autopopulates, check for correct types like Struts. 3. tile framework You can use it without Struts 4. auto-population framework It should be easy to add a Filter that autopopulates a configured form (not every time but as a standard). 5. role based actions I'm not sure what this is. 6. xml configuration of all the links or actions of your application So does web.xml i guess. 7. best practices framework bundling (scaffolding) complete with examples (many years of experience went into this one). Same thing as above. There are tutorials, examples, etc... 8. ease of use If you think of a Servlet as an Action its kind of as easy. Except for some repetative tasks that I would include to complete the servlet spec (rather than rewrite some of the container functionality to add those utils). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 8:42 AM To: Struts Users Mailing List Subject: Re: Struts MVC framework similar to that of a servlet container? Sandeep, You mentioned role based actions in your list... which has caught my eye. Can you please elaborate on this ? Or point me to some documentation ? thanks -raj Sandeep Takhar [EMAIL PROTECTED]To: Struts Users Mailing List [EMAIL PROTECTED] ahoo.comcc: Subject: Re: Struts MVC framework similar to that of a servlet container? 21/07/2003 06:08 PM Please respond to Struts Users Mailing List there's a lot of stuff it gives you out of the box. 1. solid code 2. validation framework 3. tile framework 4. auto-population framework 5. role based actions 6. xml configuration of all the links or actions of your application 7. best practices framework bundling (scaffolding) complete with examples (many years of experience went into this one). 8. ease of use I am missing about twice as many things from this list I am sure... the servlet container is sun's way of making sure that what you build is timeless (and works on their servers...) Struts solves common problems across every typical application. The servlet container does not solve these typical problems. Struts is really a pattern... sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: Hi. I've been using Struts for a long time, and I've been very happy with the framework. However, a recent discussion on Sun's Java forums has left me wondering if Struts is necessary. It seems that the servlet container itself provides an MVC framework very similar to that of Struts. All that is missing is some utilities and standardization. I was wondering if there is a flaw in my logic below, and if anyone had any comments. In comparing these two MVC frameworks, the servlet container would be the equivalent of the ActionServlet. They both read their configuration files, examine the incoming URL, and then forward the request to the configured handler. In the case of the servlet container the handlers are Servlet classes, and in the case of Struts its the Action classes. Both the container and the ActionServlet will create an instance of their handler when its requested the first time. The Servlet's service method and the Action's execute method will call some domain logic and then select a view to display to the user. The Servlet can use RequestDispatchers to encapsulate information about the view, and the Action will use an ActionForward. Doesn't this sound very similar? It seems like we are adding a lot of complexity on top of the servlet spec in order to get some common tasks done for us. But that could probably be better done by the servlet container itself. For example, Struts automatically populates the form class the developer specifies for a particular Action. But Sun could provide a standard Filter implementation which does the same thing. You can
Re: paramId in html-el:link tag - Referenceing a Constant
If you want to use a Constants class to use within JSTL syntax, here are the basic rules: 1: Constants has to be a true Bean. -- it must have a public constructor that takes no parameters (public Constants()) 2: The fields you want to access must also be true Bean fields: ie: private Static CONSTANT_KEY_1 = a_constant_key; // perhaps used by your code elsewhere public String getConstantKey() { return CONSTANT_KEY; } 3: In your .jsp: jsp:useBean class=Constants id=constants c:out value=${constants.constantKey} / hth. --adam From: Mike Duffy [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: paramId in html-el:link tag - Referenceing a Constant Date: Sun, 20 Jul 2003 14:43:25 -0700 (PDT) The struts-example\registration.jsp contains the following code: html:link page=/editSubscription.do?action=Create paramId=username paramName=registrationForm paramProperty=username bean:message key=registration.addSubscription/ /html:link Switching this to an html-el:link tag is easy. html-el:link page=/editSubscription.do?action=Create paramId=username paramName=registrationForm paramProperty=username fmt:message key=registration.addSubscription/ /html-el:link The value username is a key, so it might be better to reference a constant value: Constants.USER_NAME_KEY. My question is, how do I do this (without using sriplets)? If I don't use a quote after paramId=, I get an error when the page compiles. No matter what I put inside the quotes, it comes into the html as literal. Any suggestions? Mike __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: paramId in html-el:link tag - Referenceing a Constant
Ignore my glaring typos: 2: The fields you want to access must also be true Bean fields: ie: public Static CONSTANT_KEY_1 = a_constant_key; // perhaps used by your code elsewhere public String getConstantKey() { return CONSTANT_KEY_1; } To: [EMAIL PROTECTED] Subject: Re: paramId in html-el:link tag - Referenceing a Constant Date: Mon, 21 Jul 2003 10:43:17 -0500 If you want to use a Constants class to use within JSTL syntax, here are the basic rules: 1: Constants has to be a true Bean. -- it must have a public constructor that takes no parameters (public Constants()) 2: The fields you want to access must also be true Bean fields: ie: private Static CONSTANT_KEY_1 = a_constant_key; // perhaps used by your code elsewhere public String getConstantKey() { return CONSTANT_KEY; } 3: In your .jsp: jsp:useBean class=Constants id=constants c:out value=${constants.constantKey} / hth. --adam From: Mike Duffy [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: paramId in html-el:link tag - Referenceing a Constant Date: Sun, 20 Jul 2003 14:43:25 -0700 (PDT) The struts-example\registration.jsp contains the following code: html:link page=/editSubscription.do?action=Create paramId=username paramName=registrationForm paramProperty=username bean:message key=registration.addSubscription/ /html:link Switching this to an html-el:link tag is easy. html-el:link page=/editSubscription.do?action=Create paramId=username paramName=registrationForm paramProperty=username fmt:message key=registration.addSubscription/ /html-el:link The value username is a key, so it might be better to reference a constant value: Constants.USER_NAME_KEY. My question is, how do I do this (without using sriplets)? If I don't use a quote after paramId=, I get an error when the page compiles. No matter what I put inside the quotes, it comes into the html as literal. Any suggestions? Mike __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dificult problem, preventing population (repost)
I guess the issue is the same one you mentioned earlier which is that we have to know which action is preparing the token and which one is checking it. To do this generically means adding something to action-mapping, but since this is not an option currently then I don't think it should be since the developers of struts would have added it if this is the right spot. sandeep --- Jing Zhou [EMAIL PROTECTED] wrote: - Original Message - From: Sandeep Takhar [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED]; Jing Zhou [EMAIL PROTECTED] Sent: Friday, July 18, 2003 12:37 PM Subject: Re: dificult problem, preventing population (repost) I suppose you would get the page expired if you are using noCache... So what do people do? Do they just right their own stuff. On the application that we have built over the last year - we have opened another window and with the parameters passed to the open window we have removed the menu lines. However if the user hits backspace in certain situations, this is equivalent to pressing the back button. I know the struts workflow extension proposes a solution. But what are people doing?? I guess that is the original question, but the more I think about it the more I'm curious to know what the options are. I suppose what was mentioned before about using mappings and subclassing ActionMapping may be the only way? (This is essentially what workflow does) One possible way is to add a method prepareExecute() in the action base class. After the RequestProcessor obtains the action mapping and before populates the form bean, it invokes the prepareExecute() method on the action class. If it finds anything wrong after the prepareExecute() call, it throws an exception. This way would return the logics to handle the tokens back to action developers. Is this reasonable? Any other ideas? sandeep Jing --- Jing Zhou [EMAIL PROTECTED] wrote: Hi, Sandeep, There is no clean solution to this problem, not only in Struts but also in many others ... I wish there could be a simple way to disable the Back button. But browser vendors would say once it is disabled, who is responsible to enable it. There should be some better algorithm for this problem. Jing - Original Message - From: Sandeep Takhar [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED]; Jing Zhou [EMAIL PROTECTED] Sent: Thursday, July 17, 2003 12:35 PM Subject: Re: dificult problem, preventing population (repost) Ah... I see what you mean. Yes, not thinking that clearly, but I have not done it either so that is my excuse... So I think that to make this too complicated is not good. So the original problem states that when pressing the back button that they get back to the screen. I am wondering right now that when the press the back button they should be in the submit state again and the token check should occur again? If the previous page is a submitted page, you would get Page has Expired If the previous page is retrieved by an http get method, you would do a GET again. Sometimes I wish I could pick up the phone and sort these type of things out because I'm probably missing something again. sandeep --- Jing Zhou [EMAIL PROTECTED] wrote: - Original Message - From: Sandeep Takhar [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, July 17, 2003 7:49 AM Subject: Re: dificult problem, preventing population (repost) I think he meant isTokenValid(). Also the form tag will create the token and you can look at it in the source. You can check the token higher if you want (before population) by placing it in one of these methods on the requestProcessor.. My analysis shows we can't simply check the token at processPreProcess method, as an example. Because the RequestProcessor doesn't known when it should check and when it should not. It could involve more complicated logics than what we can imagine to get it done here, although it is not all impossible. If someone would like to layout a detail algorithm here, I believe some parameters in action mappings should be used. But that is easier to create *holes* than ... That's why it is a *difficult* problem :-) Jing (not sure logistically which one has the request signature more importantly which one makes sense)... This is in order: processMultipart processPath processLocale processContent processNoCache
How to get MessageResources in ValidatorForm
Hi, I need to get the MessageResources (i.e., application.properties) while I am in the validation of my ValidatorForm (i.e., validate(...)). The only way I have seen is to get it from the ActionServlet (servlet.getResources()), but that is deprecated... What is the new way? The doc says to get it from the Action, but I am not in the Action! dirk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to get MessageResources in ValidatorForm
Check out org.apache.struts.util package. There are bunch of ways there. -Original Message- From: Sturzebecher Dirk (extern) [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:06 PM To: ' ([EMAIL PROTECTED])' Subject: How to get MessageResources in ValidatorForm Hi, I need to get the MessageResources (i.e., application.properties) while I am in the validation of my ValidatorForm (i.e., validate(...)). The only way I have seen is to get it from the ActionServlet (servlet.getResources()), but that is deprecated... What is the new way? The doc says to get it from the Action, but I am not in the Action! dirk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Precompiling JSP with JSTL tag Libs
Cheers Craig you were spot on. From: Craig R. McClanahan [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: [OT] Precompiling JSP with JSTL tag Libs Date: Fri, 18 Jul 2003 09:14:45 -0700 (PDT) On Fri, 18 Jul 2003, Pat Quinn wrote: Date: Fri, 18 Jul 2003 16:41:33 +0100 From: Pat Quinn [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [OT] Precompiling JSP with JSTL tag Libs Sorry guys this is not a struts question but i'm hoping someone on here has had this problem before ive got an ANT task to precompile my jsp's everything worked fine until i decided to upgrade to use JSTL tag libs not i get the following error, [echo] Precompiling JSPS 2003-07-18 04:27:26 - Internal Error: File /WEB-INF/web.xml not found 2003-07-18 04:27:29 - ERROR-the file '\jsp\myjsp.jsp' generated the following general exception: org.apache.jasper.JasperException : XML parsing error on file /WEB-INF/tld/c.tld: (line 307, col 39): The string -- is not permitted within comments. [jasper] Error in class org.apache.jasper.JspC MyJsp.jsp is the only jsp which is currently using the c.tld. My ANT Task is as follows: target name=jsp depends=webinf taskdef name=jasper classname=org.apache.jasper.JspC classpath=${class.path}/ echo message=Precompiling JSPS/ jasper package=com.my.web.servlets uriroot=${web.basedir} webXmlFragment=${jsp.web.fragment.file} outputDir=${web.src.dir} / /target Any Ideas as i'm going crazy now I've tried upgrading to xerces 2.4.0 but i still get the same error. I suspect that it really is related to your XML parser ... this looks suspiciously like a bug in earlier versions of Xerces. It turned out that one of our Struts DTDs had a comment line longer than 80 characters, but caused Xerces to output a totally bogus error just like this, pointing at a place totally unrelated to where the problem really was. Note that, if you're using JDK 1.4, simply putting Xerces 2.4 into your classpath does *not* replace the use of the built-in parser. You have to put it in the endorsed standards directory ($JAVA_HOME/jre/endorsed I *think* -- it's in the JDK docs), or use a system property to declare the directory containing this JAR to be your endorsed directory. To use an updated parser in Tomcat 4.1 or later, put it in $CATALINA_HOME/common/endorsed. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to get MessageResources in ValidatorForm
The only thing in there would be MessageResource r=MessageResourcesFactory.createFactory().createResources(String config); but what is config (besides a String)? and what local will be used? -Original Message- From: Alex Shneyderman [mailto:[EMAIL PROTECTED] Sent: Montag, 21. Juli 2003 18:08 To: 'Struts Users Mailing List' Subject: RE: How to get MessageResources in ValidatorForm Check out org.apache.struts.util package. There are bunch of ways there. -Original Message- From: Sturzebecher Dirk (extern) [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:06 PM To: ' ([EMAIL PROTECTED])' Subject: How to get MessageResources in ValidatorForm Hi, I need to get the MessageResources (i.e., application.properties) while I am in the validation of my ValidatorForm (i.e., validate(...)). The only way I have seen is to get it from the ActionServlet (servlet.getResources()), but that is deprecated... What is the new way? The doc says to get it from the Action, but I am not in the Action! dirk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:form tag and coupling between ActionForm and Action
Hi, Does anyone know why the name and type attributes of the form tag are deprecated? It seems to me that a tight coupling between a jsp and it's associated ActionForm makes more sense than coupling the ActionForm with the Action, which is the consequence of the putting the name attribute in the ActionMapping. What if you want to write an Action that can service a family of several different ActionForms?? Any help or insight would be appreciated. Thanks, -Chris __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:form tag and coupling between ActionForm and Action
What if you want to write an Action that can service a family of several different ActionForms?? You can do it. Just need to do it yourself (well sort of). Alex. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts MVC framework similar to that of a servlet container?
ok. assume i go through the process below. now i have RANKo framework :) (which I did actually). Then I learn about Struts and say, hey this serves the same function as my framework, let me switch to that cause everybody uses that so its standardized in some way. Then, some time later you realize (perhaps wrongly) that it duplicates a lot of servlet container functionality and that the MVC part of this framework is already there. That's why I'm asking myself how is writing a Servlet different from writing an Action. For every Action in a Struts application I can write a Servlet. Instead of putting my mappings in struts-config.xml, I will put them in web.xml. Now, I know there is some other common code that is currently not in the servlet spec, but is in Struts. My question was is it better to add some of those to the servlet spec, rahter than rewriting part of it. Or, second scenario. Let say I'm using Struts. Then I write an Action that manages these Task objects. I have a configuration file for different Task objects. I write an abstract Task class which different Tasks can extend. My Action is the controller for all the Tasks. I figure out which task to call examining the URL. Over time, I add to this framework to make it easier to use. So now i have a task-config.xml where I specify all my Tasks. I have TaskAction (a controller). And bunch of 'utility code'. Then I ask myself, is this that much different from the Actions Struts provides? Note that I'm not necessarily saying this is the case, just asking for some reasons why that is not the case. General information about frameworks and how they come about does not address the specific question of wheter this particular framework duplicates a lot of functionality of its parent environment. Either way, thanks for trying :). ranko -Original Message- From: Navjot Singh [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:28 AM To: Struts Users Mailing List Subject: RE: Struts MVC framework similar to that of a servlet container? hi ranko, Assume you don't use struts. You start writing your first app for your requirements. Being an expert programmer, you have done with first one by wriitng lots of utility classes and base code. Now you start with second. You will realize that the second app can use most of the functionality (except business logic) from the first app. NOW WHAT? You will dig out some code from first app that can be RE-USED in second app. That code can be called a framework(;et's call it RANKo framework ;-) and that's precisely what STRUTS intends to provide. Anyway, it's your viewpoint. Being a creator of one servlet/xml/xslt based framework myself(almost 18 months back), I know what is *common code* required for *most of the apps* and the efforts/time needed to create that framework. So, when starting with an app, i can find and USE as good framework as STRUTS, nothing like that. I don't say STRUTS is good enough, you may have diff requirements altogether so struts may not be the best choice for you. You write on your own but it's always good to look around for good frameworks and build ON TOP OF THEM. hope it clears. still i am trying to give answers to few of the individual points below. -navjot | 1. solid code |so does the container i guess. true but container gives you world of choice. Struts gives you the base code for *common* requirements. So, you save time writing on *that common* code. |2. validation framework |This is one of those changes that could be added by way of utility classes. |Have that Filter that autopopulates, check for correct types like Struts. Agreed. |3. tile framework |You can use it without Struts Struts also does not enforce any fix presentation model. Could be xslt/velocity/jsp any. | 4. auto-population framework |It should be easy to add a Filter that autopopulates a configured form (not |every time but as a standard). | | 5. role based actions |I'm not sure what this is. Same as roles in servlet specs but checking is deferred per action. |6. xml configuration of all the links or actions of |your application So does web.xml i guess. but here it is module based config. easy of maintenance ;-) |7. best practices framework bundling (scaffolding)complete with examples (many years of experience went |into this one). |Same thing as above. There are tutorials, examples, etc... | | | 8. ease of use |If you think of a Servlet as an Action its kind of as easy. |Except for some |repetative tasks that I would include to complete the servlet spec (rather |than rewrite some of the container functionality to add those utils). | |-Original Message- |From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] |Sent: Monday, July 21, 2003 8:42 AM |To: Struts Users Mailing List |Subject: Re: Struts MVC framework similar to that of a servlet |container? | | | |Sandeep, |You mentioned role based actions in your list... which has caught my eye. |Can you please elaborate on
Use ApplicationRessources.properties values in html:options value=.... tag
Hello! I want to use some values from the properties file in my JSP page. ApplicationRessources.properties file: language.german = Deutsch language.english = Englisch Normally such values are used within a JSP page like this: bean:message key= language.german / But how I can use this value within a html:options value= tag? html:options value=bean:message key= language.german / does not work. Dirk
RE: Struts MVC framework similar to that of a servlet container?
Yes Struts does definitely solve many problems and make it easier. But is seems that it solves a lot of problems that are already solved. I'm looking for the reasons why this would not be the case. Thanks for the help, ranko -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:21 AM To: Struts Users Mailing List Subject: RE: Struts MVC framework similar to that of a servlet container? I guess the main difference between what you mention and struts is that you can use this stuff right away for the app you want to build without modification. As long as you understand the concepts you can apply them. Similar to how you understand a servlet/filter spec. Now you have common problems solved. You don't have to code them or copy and paste from somewhere. You also have the ability to auto-populate to lists which is pretty neat. sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: there's a lot of stuff it gives you out of the box. 1. solid code so does the container i guess. 2. validation framework This is one of those changes that could be added by way of utility classes. Have that Filter that autopopulates, check for correct types like Struts. 3. tile framework You can use it without Struts 4. auto-population framework It should be easy to add a Filter that autopopulates a configured form (not every time but as a standard). 5. role based actions I'm not sure what this is. 6. xml configuration of all the links or actions of your application So does web.xml i guess. 7. best practices framework bundling (scaffolding) complete with examples (many years of experience went into this one). Same thing as above. There are tutorials, examples, etc... 8. ease of use If you think of a Servlet as an Action its kind of as easy. Except for some repetative tasks that I would include to complete the servlet spec (rather than rewrite some of the container functionality to add those utils). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 8:42 AM To: Struts Users Mailing List Subject: Re: Struts MVC framework similar to that of a servlet container? Sandeep, You mentioned role based actions in your list... which has caught my eye. Can you please elaborate on this ? Or point me to some documentation ? thanks -raj Sandeep Takhar [EMAIL PROTECTED]To: Struts Users Mailing List [EMAIL PROTECTED] ahoo.comcc: Subject: Re: Struts MVC framework similar to that of a servlet container? 21/07/2003 06:08 PM Please respond to Struts Users Mailing List there's a lot of stuff it gives you out of the box. 1. solid code 2. validation framework 3. tile framework 4. auto-population framework 5. role based actions 6. xml configuration of all the links or actions of your application 7. best practices framework bundling (scaffolding) complete with examples (many years of experience went into this one). 8. ease of use I am missing about twice as many things from this list I am sure... the servlet container is sun's way of making sure that what you build is timeless (and works on their servers...) Struts solves common problems across every typical application. The servlet container does not solve these typical problems. Struts is really a pattern... sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: Hi. I've been using Struts for a long time, and I've been very happy with the framework. However, a recent discussion on Sun's Java forums has left me wondering if Struts is necessary. It seems that the servlet container itself provides an MVC framework very similar to that of Struts. All that is missing is some utilities and standardization. I was wondering if there is a flaw in my logic below, and if anyone had any comments. In comparing these two MVC frameworks, the servlet container would be the equivalent of the ActionServlet. They both read their configuration files, examine the incoming URL, and then forward the request to the configured handler. In the case of the servlet container the handlers are Servlet classes, and in the case of Struts its the Action classes. Both the container and the ActionServlet will create an instance of their handler when its requested the first time. The Servlet's service method and the Action's execute method will call some domain logic and then select a view to display to the user. The Servlet can use RequestDispatchers to encapsulate information about the view, and the Action will use an ActionForward. Doesn't this sound very similar? It seems like we are adding a lot of complexity on
RE: html:form tag and coupling between ActionForm and Action
I just wanted to add a little bit more to Alex's comment. 1.Create a form interface that represents your family of forms abstract class PersonForm extends ActionForm{ getFirstName(); getLastName(); getMiddleName(); } 2.Make your forms implement that interface 3.In your action cast ActionForm to your interface PersonProcessingAction extends Action { Person personForm = (PersonForm)form; String first = personForm.getFirstName(); } -Original Message- From: Alex Shneyderman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:31 PM To: 'Struts Users Mailing List' Subject: RE: html:form tag and coupling between ActionForm and Action What if you want to write an Action that can service a family of several different ActionForms?? You can do it. Just need to do it yourself (well sort of). Alex. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Resetting inputparameters to a jsp-page?
Hi, Is there an easy way to reset inputparameters? I use them like this input name=dato type=text class=small id=dato size=5 maxlength=5 value=c:out value='${param.dato}' / The problem is that a reset-button will not reset the fields when using jstl. I have a feeling this is not possible but I just want to ask. - Terje
RE: Struts MVC framework similar to that of a servlet container?
for my $0.02. Using just pure servlet and base JSP, dealing with forms is not intuitive or clean. You either rely on too much code in a JSP, or too much reading and parsing at the start of your servlets. And, the development cycle increases as your changes increase. I find the Struts mode to be clean and simple. Need to change a field, add a field. Change one class (the ActionForm, or not at all with a dynaform), modify the .jsp presentation. And then account for the field change in the business logic. Combine it with XDoclet, and you've got immediate Data/Value Objects that can be generated from the ActionForm itself, ready to be passed back to your EJB level code (using CMP, you never have to account for the field in the logic, unless you're doing business level decisions). The mechanisms in place for detailing messages back to the user (ie, ActionErrors) are very clean, easly integrated with field-specific messages. Seamless integration with Java's i18n functionality. I'm looking for the reasons why this would not be the case. Are you looking for where using the base Sevlet layer is more advantageous over using Struts? Or, are you looking for areas that Struts just doesn't handle, leaving a gaping hole? Are you being persnickity, or is there a serious question/concern ? From: Ranko Bijelonic [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: Struts MVC framework similar to that of a servlet container? Date: Mon, 21 Jul 2003 12:38:22 -0400 Yes Struts does definitely solve many problems and make it easier. But is seems that it solves a lot of problems that are already solved. I'm looking for the reasons why this would not be the case. Thanks for the help, ranko -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:21 AM To: Struts Users Mailing List Subject: RE: Struts MVC framework similar to that of a servlet container? I guess the main difference between what you mention and struts is that you can use this stuff right away for the app you want to build without modification. As long as you understand the concepts you can apply them. Similar to how you understand a servlet/filter spec. Now you have common problems solved. You don't have to code them or copy and paste from somewhere. You also have the ability to auto-populate to lists which is pretty neat. sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: there's a lot of stuff it gives you out of the box. 1. solid code so does the container i guess. 2. validation framework This is one of those changes that could be added by way of utility classes. Have that Filter that autopopulates, check for correct types like Struts. 3. tile framework You can use it without Struts 4. auto-population framework It should be easy to add a Filter that autopopulates a configured form (not every time but as a standard). 5. role based actions I'm not sure what this is. 6. xml configuration of all the links or actions of your application So does web.xml i guess. 7. best practices framework bundling (scaffolding) complete with examples (many years of experience went into this one). Same thing as above. There are tutorials, examples, etc... 8. ease of use If you think of a Servlet as an Action its kind of as easy. Except for some repetative tasks that I would include to complete the servlet spec (rather than rewrite some of the container functionality to add those utils). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 8:42 AM To: Struts Users Mailing List Subject: Re: Struts MVC framework similar to that of a servlet container? Sandeep, You mentioned role based actions in your list... which has caught my eye. Can you please elaborate on this ? Or point me to some documentation ? thanks -raj Sandeep Takhar [EMAIL PROTECTED]To: Struts Users Mailing List [EMAIL PROTECTED] ahoo.comcc: Subject: Re: Struts MVC framework similar to that of a servlet container? 21/07/2003 06:08 PM Please respond to Struts Users Mailing List there's a lot of stuff it gives you out of the box. 1. solid code 2. validation framework 3. tile framework 4. auto-population framework 5. role based actions 6. xml configuration of all the links or actions of your application 7. best practices framework bundling (scaffolding) complete with examples (many years of experience went into this one). 8. ease of use I am missing about twice as many things from this list I am sure... the servlet container is sun's way of making sure that what you build is timeless (and works on
RE: html:form tag and coupling between ActionForm and Action
I don't think Daniel's idea will work. If the action form does not exist then struts wants to instantiate the form. Therefore struts needs to know the type. It might work if you have a session scope form already there. I think of actions as the most dependent class, i.e. nothing should depend on actions (no other classes should know anything about actions), actions should depend on everything (well not everything, but definitely the model and the view). Because they are such nasty beasts, (and because in struts they should have no state), they should be very small. Since they are so small the architecture that puts effort into making them generic and reusable may be misguided. Brendan -Original Message- From: Suzette Daniel [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 9:41 AM To: 'Struts Users Mailing List' Subject: RE: html:form tag and coupling between ActionForm and Action I just wanted to add a little bit more to Alex's comment. 1.Create a form interface that represents your family of forms abstract class PersonForm extends ActionForm{ getFirstName(); getLastName(); getMiddleName(); } 2.Make your forms implement that interface 3.In your action cast ActionForm to your interface PersonProcessingAction extends Action { Person personForm = (PersonForm)form; String first = personForm.getFirstName(); } -Original Message- From: Alex Shneyderman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:31 PM To: 'Struts Users Mailing List' Subject: RE: html:form tag and coupling between ActionForm and Action What if you want to write an Action that can service a family of several different ActionForms?? You can do it. Just need to do it yourself (well sort of). Alex. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:form tag and coupling between ActionForm and Action
Actually I meant something like this: Create BaseAction with three methods { protected ActionForm createForm ( HttpServletRequest request, String actionName) throws Exception { ModuleConfig mc = RequestUtils.getRequestModuleConfig (request); ActionMapping am = (ActionMapping) mc.findActionConfig (actionName); return RequestUtils.createActionForm (request, am, mc, getServlet ()); } protected void attachForm ( HttpServletRequest request, String actionName, ActionForm form) throws Exception { ModuleConfig mc = RequestUtils.getRequestModuleConfig (request); ActionMapping am = (ActionMapping) mc.findActionConfig (actionName); if ((am.getScope () == null) || (am.getScope ().equalsIgnoreCase (session))) { request.getSession ().setAttribute (am.getName (), form); } else { request.setAttribute (am.getName (), form); } } protected void removeForm (HttpServletRequest request, String actionName) { ModuleConfig mc = RequestUtils.getRequestModuleConfig (request); ActionMapping am = (ActionMapping) mc.findActionConfig (actionName); if ((am.getScope () == null) || (am.getScope ().equalsIgnoreCase (session))) { request.getSession ().removeAttribute (am.getName ()); } else { request.removeAttribute (am.getName ()); } } } You can use theese 3 methods in actions that need to Dispatch (that is why my BaseAction extends DispatchAction). So you get request: createForm you need, populate its values, attachForm and redirect to the view you want to see it in. Be careful not to redirect to action that uses the form you just populated, it might wipe out all work you have done. If you use application scope forms you would have to add it in. I never do so it is not there. Alex. -Original Message- From: Suzette Daniel [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:41 PM To: 'Struts Users Mailing List' Subject: RE: html:form tag and coupling between ActionForm and Action I just wanted to add a little bit more to Alex's comment. 1.Create a form interface that represents your family of forms abstract class PersonForm extends ActionForm{ getFirstName(); getLastName(); getMiddleName(); } 2.Make your forms implement that interface 3.In your action cast ActionForm to your interface PersonProcessingAction extends Action { Person personForm = (PersonForm)form; String first = personForm.getFirstName(); } -Original Message- From: Alex Shneyderman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:31 PM To: 'Struts Users Mailing List' Subject: RE: html:form tag and coupling between ActionForm and Action What if you want to write an Action that can service a family of several different ActionForms?? You can do it. Just need to do it yourself (well sort of). Alex. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Suggestions
-Original Message- From: Saman Ghodsian [mailto:[EMAIL PROTECTED] Sent: Saturday, July 19, 2003 10:43 AM To: 'Struts Users Mailing List' Subject: Suggestions Hi everyone, I just completed phase one of my project which is the development and testing of my business model. some 120 classes, now I'm evaluating options to implement my front end. I've been looking at struts as an option, but I still have some concerns about how to go about it. I'm looking for tools that can help me bypass the hassle of writing all the action, forms, xml, etc ... Instead I would like to use the same kind of tool I used with my model UML --- xdoclet --- OJB torque - DB It works wonders and I'm very satisfied with the results I would like to do the same thing with my front end UML struts [ Action, Form, XML, JSP ] Then I can use something like a GUI to go to each screen and adjust it manually. I'm thinking on implementing these kind of aproach Each class in my model would have: List (With add, edit, delete, search capabilites) detail ( that comes from the list) Input very much appreciated Thanks Saman - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 1.1 Final - Validate Date field in struts-validator.war
I am not able to validate the date field when I am in French Canadian Mode. SomeOne have the same problem ? Details : When I click on French Canadian | Francais Canadien - On the JavaScript Type Form the integer field should fall in a range of 100-200 and the date field should have a format of 'dd-MM-', Date field should be valid if I enter a date like ' dd-MM- '. However, it only valid 'MM/dd/'. So, when I click on JavaScript Type Form - with JavaScript Validation and Server Validation, the date field validation stay with 'MM/dd/'. If someone have the same problem, please send me an email at [EMAIL PROTECTED] cause I'm gonna be crazy!! I have tried jsType.jsp with : OS : WinXP and Win2000 Browser : IE 6 and Mozilla 1.4 Tomcat 4.1.24 JAVA 1.4.2 Struts 1.1.0 Thanks a lot! G Cormier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validate() method - and form in session scope
Hello all, If an ActionForm bean's scope is session, does the validate() method get called only once ?? I have several actions that post to the same form, but it seems that the validate method is only called once when the form gets created Any help is appreciated. Khalid p.s. i am using Struts 1.0.2 - Original Message - From: Guillaume Cormier [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:19 AM Subject: Struts 1.1 Final - Validate Date field in struts-validator.war I am not able to validate the date field when I am in French Canadian Mode. SomeOne have the same problem ? Details : When I click on French Canadian | Francais Canadien - On the JavaScript Type Form the integer field should fall in a range of 100-200 and the date field should have a format of 'dd-MM-', Date field should be valid if I enter a date like ' dd-MM- '. However, it only valid 'MM/dd/'. So, when I click on JavaScript Type Form - with JavaScript Validation and Server Validation, the date field validation stay with 'MM/dd/'. If someone have the same problem, please send me an email at [EMAIL PROTECTED] cause I'm gonna be crazy!! I have tried jsType.jsp with : OS : WinXP and Win2000 Browser : IE 6 and Mozilla 1.4 Tomcat 4.1.24 JAVA 1.4.2 Struts 1.1.0 Thanks a lot! G Cormier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with ActionErrors
Hi, I am fairly new to struts and I am using struts1.1. I have some code which basically follows the LogonAction example that comes with the code. I use the message tag with id=error to view the errors. When the validator returns errors, they are displayed correctly. When my action saves the errors, I get a Cannot find bean error in any scope?? I am not sure of the exact wording of the error (reciting from memory). Sorry that I cannot provide more exact details, but the code is not available to me at this time. Has anyone seen this before or have any ideas on where to look to solve the problem. Thanks. Chuck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validate() method - and form in session scope (solved)
humm..was a dumb mistake :) in struts-config i had validate set to false :) - Original Message - From: Khalid K. [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:23 AM Subject: validate() method - and form in session scope Hello all, If an ActionForm bean's scope is session, does the validate() method get called only once ?? I have several actions that post to the same form, but it seems that the validate method is only called once when the form gets created Any help is appreciated. Khalid p.s. i am using Struts 1.0.2 - Original Message - From: Guillaume Cormier [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:19 AM Subject: Struts 1.1 Final - Validate Date field in struts-validator.war I am not able to validate the date field when I am in French Canadian Mode. SomeOne have the same problem ? Details : When I click on French Canadian | Francais Canadien - On the JavaScript Type Form the integer field should fall in a range of 100-200 and the date field should have a format of 'dd-MM-', Date field should be valid if I enter a date like ' dd-MM- '. However, it only valid 'MM/dd/'. So, when I click on JavaScript Type Form - with JavaScript Validation and Server Validation, the date field validation stay with 'MM/dd/'. If someone have the same problem, please send me an email at [EMAIL PROTECTED] cause I'm gonna be crazy!! I have tried jsType.jsp with : OS : WinXP and Win2000 Browser : IE 6 and Mozilla 1.4 Tomcat 4.1.24 JAVA 1.4.2 Struts 1.1.0 Thanks a lot! G Cormier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts MVC framework similar to that of a servlet container?
I would not call it persnickety, although there is no immediate problem. My concern is that there is a lot of duplication of funtionality (if there is). If form handling equal to that of Struts was added to the Servlet specification (for example by providing a standard implementation of a Filter to do so given a configuration in web.xml), would it then be equivalent to Sturts? Basically, it seems to me that much of the framework that Struts provides is already provided by the Servlet specification. If the energy used to develop Struts was used to make JCP somehow make these ease of programing changes that are missing, would we end up with a much better, cleaner, and simpler framework? Or am I completely off here and the MVC framework provided by the container is really not the same as the one provided by Struts. Again, its a general question, I have no pressing need that needs to be addressed. Thanks. ranko -Original Message- From: Adam Levine [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:49 PM To: [EMAIL PROTECTED] Subject: RE: Struts MVC framework similar to that of a servlet container? for my $0.02. Using just pure servlet and base JSP, dealing with forms is not intuitive or clean. You either rely on too much code in a JSP, or too much reading and parsing at the start of your servlets. And, the development cycle increases as your changes increase. I find the Struts mode to be clean and simple. Need to change a field, add a field. Change one class (the ActionForm, or not at all with a dynaform), modify the .jsp presentation. And then account for the field change in the business logic. Combine it with XDoclet, and you've got immediate Data/Value Objects that can be generated from the ActionForm itself, ready to be passed back to your EJB level code (using CMP, you never have to account for the field in the logic, unless you're doing business level decisions). The mechanisms in place for detailing messages back to the user (ie, ActionErrors) are very clean, easly integrated with field-specific messages. Seamless integration with Java's i18n functionality. I'm looking for the reasons why this would not be the case. Are you looking for where using the base Sevlet layer is more advantageous over using Struts? Or, are you looking for areas that Struts just doesn't handle, leaving a gaping hole? Are you being persnickity, or is there a serious question/concern ? From: Ranko Bijelonic [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: Struts MVC framework similar to that of a servlet container? Date: Mon, 21 Jul 2003 12:38:22 -0400 Yes Struts does definitely solve many problems and make it easier. But is seems that it solves a lot of problems that are already solved. I'm looking for the reasons why this would not be the case. Thanks for the help, ranko -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:21 AM To: Struts Users Mailing List Subject: RE: Struts MVC framework similar to that of a servlet container? I guess the main difference between what you mention and struts is that you can use this stuff right away for the app you want to build without modification. As long as you understand the concepts you can apply them. Similar to how you understand a servlet/filter spec. Now you have common problems solved. You don't have to code them or copy and paste from somewhere. You also have the ability to auto-populate to lists which is pretty neat. sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: there's a lot of stuff it gives you out of the box. 1. solid code so does the container i guess. 2. validation framework This is one of those changes that could be added by way of utility classes. Have that Filter that autopopulates, check for correct types like Struts. 3. tile framework You can use it without Struts 4. auto-population framework It should be easy to add a Filter that autopopulates a configured form (not every time but as a standard). 5. role based actions I'm not sure what this is. 6. xml configuration of all the links or actions of your application So does web.xml i guess. 7. best practices framework bundling (scaffolding) complete with examples (many years of experience went into this one). Same thing as above. There are tutorials, examples, etc... 8. ease of use If you think of a Servlet as an Action its kind of as easy. Except for some repetative tasks that I would include to complete the servlet spec (rather than rewrite some of the container functionality to add those utils). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 8:42 AM To: Struts Users Mailing List Subject: Re: Struts MVC framework similar to that of a servlet container?
RE: Problem with ActionErrors
Show us how your saving the errors and how your accessing them in the JSP. If you can dig up the logs with your exact errors that would be very helpful. -Tim -Original Message- From: Canning, Chuck [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 1:28 PM To: '[EMAIL PROTECTED]' Subject: Problem with ActionErrors Hi, I am fairly new to struts and I am using struts1.1. I have some code which basically follows the LogonAction example that comes with the code. I use the message tag with id=error to view the errors. When the validator returns errors, they are displayed correctly. When my action saves the errors, I get a Cannot find bean error in any scope?? I am not sure of the exact wording of the error (reciting from memory). Sorry that I cannot provide more exact details, but the code is not available to me at this time. Has anyone seen this before or have any ideas on where to look to solve the problem. Thanks. Chuck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using the validator for client side field modifications
You can call validateDate, etc anywhere in your form, provide that you loaded then correctly. Something like onblur=validateInteger() will validate whether they are integers: I don't think they implemented validateDecimals yet, so Hex and Oct would be considered as valid as well. -Original Message- From: Gregory F. March [mailto:[EMAIL PROTECTED] Sent: July 21, 2003 8:49 AM To: Struts Users Mailing List Subject: Using the validator for client side field modifications Hi. I've been reading through some of the documentation and I haven't found exactly what I'm looking for. I'm sure (famous last words) that this is possible, but I need confirmation for a presentation I'm making. I have a form with text fields that I need to convert to upper case, verify they contain only numbers, etc., but I need to do it real time, i.e. using onBlur (this is due to the fact that I am converting an existing application and need similar functionality). The users want to see the fields converted and checked when they tab/click out of the fields. I have been reading about the validator and the validator:javascript formname=myForm / onSubmit=validateMyForm tag combo, but I'm not sure it does what I want as it seems to be doing a *form* validation. Could someone point me in the correct direction? My goal is to consolidate all the javascript into the validator.xml file so I can reference it by name. Should I just be using a simple javascript include instead? Thanks, /greg -- Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
A column consisting of html:select widgets
Dear All, I'm using struts 1.0.2. I have a requirement where i need to show a column consisting of dropdown lists. Every row of the table for the column shows a dropdown with the same list of options. I've used String[] getCategory() and setCategory(String[]) getter/setter in thr ActionForm. On the form submission i get the correct selected values for all the rows. Now my questions is how do I set the values of these dropdown from he database when the page is shown for the very first time. I've tried setCategory(String[]) setter, but the dropdowns don't show the correct option selected! I've also tried to search from the mail archive to no avail. Any help or pointers would be greatly appreciated. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Use ApplicationRessources.properties values in html:options value=.... tag
1. html:options expects a Collection, I think. 2. Try to change to ' for value='bean:.. Key=.. /' -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: July 21, 2003 10:38 AM To: [EMAIL PROTECTED] Subject: Use ApplicationRessources.properties values in html:options value= tag Hello! I want to use some values from the properties file in my JSP page. ApplicationRessources.properties file: language.german = Deutsch language.english = Englisch Normally such values are used within a JSP page like this: bean:message key= language.german / But how I can use this value within a html:options value= tag? html:options value=bean:message key= language.german / does not work. Dirk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
logic:iterate tag fails on large dataset, succeeds on smallone?
I am trying to do a very simple data-display web application using Struts, with MySQL on the back end. Basically, I take a ResultSet and its ResultSetMetaData and put it into some beans. I have a TableDataView object which contains a FieldList and a RecordCollection. FieldList has a property called fields which returns a List. RecordCollection implements Collection, and containts an ArrayList of Record objects; Record returns an array of the field value objects as the property fieldValues. My JSP page(showtable.jsp)looks like: html:html TABLE TR logic:iterate id=fields name=tableDataView property=fieldList THbean:write name=fields //TH /logic:iterate /TR logic:iterate id=record name=tableDataView property=recordList TR logic:iterate id=fvalues name=record property=fieldValues TDbean:write name=fvalues //TD /logic:iterate /TR /logic:iterate /TABLE /html:html If I run this on a small table, with 10 fields and 11 records, it works fine. If I run it on a large table, with 28 fields and 307 records, then I get: javax.servlet.ServletException: cannot find bean fvalues in any scope at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageCon textImpl.java:533) at org.apache.jsp.showtable_jsp._jspService(showtable_jsp.java:192) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) ...[deletia...I can't imagine that any of it has anything to do with my error] at java.lang.Thread.run(Thread.java:536) I can eliminate this problem if I reduce the number of fields in the table to 9 or 10, but I can't see why this should be a problem, and certainly not why my looping bean should suddenly become unavailable. My unit tests seem to be telling me that my Record bean should be properly returning a list of 28 field values. I don't know at what point things are breaking down. I'm not experienced with JSP tag programming, so I haven't been able to learn much from IterateTag.java, or the compiled version of showtable.jsp. Any pointers on my problem would be much appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts MVC framework similar to that of a servlet container?
--- Ranko Bijelonic [EMAIL PROTECTED] wrote: I would not call it persnickety, although there is no immediate problem. My concern is that there is a lot of duplication of funtionality (if there is). If form handling equal to that of Struts was added to the Servlet specification (for example by providing a standard implementation of a Filter to do so given a configuration in web.xml), would it then be equivalent to Sturts? The fact is that the Servlet spec does not provide equivalent features to Struts. Struts wouldn't exist if the Servlet spec already had everything web developers needed. Basically, it seems to me that much of the framework that Struts provides is already provided by the Servlet specification. No, Struts provides a higher level framework for creating webapps that the Servlet spec does not address. JSF does provide a standardized framework comparable to Struts but it isn't finalized yet. If the energy used to develop Struts was used to make JCP somehow make these ease of programing changes that are missing, would we end up with a much better, cleaner, and simpler framework? JSF is, in many ways, a standardized version of Struts. However, they're not exactly the same and can be used together. David Or am I completely off here and the MVC framework provided by the container is really not the same as the one provided by Struts. Again, its a general question, I have no pressing need that needs to be addressed. Thanks. ranko -Original Message- From: Adam Levine [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:49 PM To: [EMAIL PROTECTED] Subject: RE: Struts MVC framework similar to that of a servlet container? for my $0.02. Using just pure servlet and base JSP, dealing with forms is not intuitive or clean. You either rely on too much code in a JSP, or too much reading and parsing at the start of your servlets. And, the development cycle increases as your changes increase. I find the Struts mode to be clean and simple. Need to change a field, add a field. Change one class (the ActionForm, or not at all with a dynaform), modify the .jsp presentation. And then account for the field change in the business logic. Combine it with XDoclet, and you've got immediate Data/Value Objects that can be generated from the ActionForm itself, ready to be passed back to your EJB level code (using CMP, you never have to account for the field in the logic, unless you're doing business level decisions). The mechanisms in place for detailing messages back to the user (ie, ActionErrors) are very clean, easly integrated with field-specific messages. Seamless integration with Java's i18n functionality. I'm looking for the reasons why this would not be the case. Are you looking for where using the base Sevlet layer is more advantageous over using Struts? Or, are you looking for areas that Struts just doesn't handle, leaving a gaping hole? Are you being persnickity, or is there a serious question/concern ? From: Ranko Bijelonic [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: Struts MVC framework similar to that of a servlet container? Date: Mon, 21 Jul 2003 12:38:22 -0400 Yes Struts does definitely solve many problems and make it easier. But is seems that it solves a lot of problems that are already solved. I'm looking for the reasons why this would not be the case. Thanks for the help, ranko -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:21 AM To: Struts Users Mailing List Subject: RE: Struts MVC framework similar to that of a servlet container? I guess the main difference between what you mention and struts is that you can use this stuff right away for the app you want to build without modification. As long as you understand the concepts you can apply them. Similar to how you understand a servlet/filter spec. Now you have common problems solved. You don't have to code them or copy and paste from somewhere. You also have the ability to auto-populate to lists which is pretty neat. sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: there's a lot of stuff it gives you out of the box. 1. solid code so does the container i guess. 2. validation framework This is one of those changes that could be added by way of utility classes. Have that Filter that autopopulates, check for correct types like Struts. 3. tile framework You can use it without Struts 4. auto-population framework It should be easy to add a Filter that autopopulates a configured form (not every time but as a standard). 5. role based actions I'm not sure what this is. 6. xml configuration of all the links or actions of your application So does web.xml i guess.
RE: A column consisting of html:select widgets
Atta, In your JSP page do the following html:select property=item html:options collection=myOptions property=value labelProperty=label/ /html:select Where the collection myOptions is a List of beans. Those beans have two fields value and label Hope that helps! -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:46 PM To: Struts Users Mailing List Subject: A column consisting of html:select widgets Dear All, I'm using struts 1.0.2. I have a requirement where i need to show a column consisting of dropdown lists. Every row of the table for the column shows a dropdown with the same list of options. I've used String[] getCategory() and setCategory(String[]) getter/setter in thr ActionForm. On the form submission i get the correct selected values for all the rows. Now my questions is how do I set the values of these dropdown from he database when the page is shown for the very first time. I've tried setCategory(String[]) setter, but the dropdowns don't show the correct option selected! I've also tried to search from the mail archive to no avail. Any help or pointers would be greatly appreciated. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate tag fails on large dataset, succeeds on small one?
I suggest you use the JSTL's c:forEach tag instead of the Struts iterate tag. I have dynamic query pages that use forEach and display n number of fields with no problem. As an added bonus you'll get improved page rendering time because containers can optimize the performance of JSTL tags. David --- Aaron Humphrey [EMAIL PROTECTED] wrote: I am trying to do a very simple data-display web application using Struts, with MySQL on the back end. Basically, I take a ResultSet and its ResultSetMetaData and put it into some beans. I have a TableDataView object which contains a FieldList and a RecordCollection. FieldList has a property called fields which returns a List. RecordCollection implements Collection, and containts an ArrayList of Record objects; Record returns an array of the field value objects as the property fieldValues. My JSP page(showtable.jsp)looks like: html:html TABLE TR logic:iterate id=fields name=tableDataView property=fieldList THbean:write name=fields //TH /logic:iterate /TR logic:iterate id=record name=tableDataView property=recordList TR logic:iterate id=fvalues name=record property=fieldValues TDbean:write name=fvalues //TD /logic:iterate /TR /logic:iterate /TABLE /html:html If I run this on a small table, with 10 fields and 11 records, it works fine. If I run it on a large table, with 28 fields and 307 records, then I get: javax.servlet.ServletException: cannot find bean fvalues in any scope at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageCon textImpl.java:533) at org.apache.jsp.showtable_jsp._jspService(showtable_jsp.java:192) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) ...[deletia...I can't imagine that any of it has anything to do with my error] at java.lang.Thread.run(Thread.java:536) I can eliminate this problem if I reduce the number of fields in the table to 9 or 10, but I can't see why this should be a problem, and certainly not why my looping bean should suddenly become unavailable. My unit tests seem to be telling me that my Record bean should be properly returning a list of 28 field values. I don't know at what point things are breaking down. I'm not experienced with JSP tag programming, so I haven't been able to learn much from IterateTag.java, or the compiled version of showtable.jsp. Any pointers on my problem would be much appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Ant task to merge Struts config files
Hi, Is there an Ant task to merge the Struts config files for various sub-modules into 1 struts-config.xml file. Thanks, Vijay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using the validator for client side field modifications
On Jul 21, 2003, Yansheng Lin [EMAIL PROTECTED] wrote: |You can call validateDate, etc anywhere in your form, provide that you loaded |then correctly. | |Something like onblur=validateInteger() will validate whether they are |integers: Yansheng, So, what you are saying is that struts will insert code (javascript) into the html it generates so that the onblur validation can take place? In which case, I can create custom validation rules for fields with my own custom javascript and they will be inserted as well? As in: onBlur=validateAllUppercase() Thanks, /greg -- Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts MVC framework similar to that of a servlet container?
I'm guessing you already have code to solve these problems... Another advantage is that you can hire a struts coder/expert... There is miles of readable framework code that is easily extendable and built (from my point of view) by coders better than myself. Something else to keep in mind. sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: Yes Struts does definitely solve many problems and make it easier. But is seems that it solves a lot of problems that are already solved. I'm looking for the reasons why this would not be the case. Thanks for the help, ranko -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:21 AM To: Struts Users Mailing List Subject: RE: Struts MVC framework similar to that of a servlet container? I guess the main difference between what you mention and struts is that you can use this stuff right away for the app you want to build without modification. As long as you understand the concepts you can apply them. Similar to how you understand a servlet/filter spec. Now you have common problems solved. You don't have to code them or copy and paste from somewhere. You also have the ability to auto-populate to lists which is pretty neat. sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: there's a lot of stuff it gives you out of the box. 1. solid code so does the container i guess. 2. validation framework This is one of those changes that could be added by way of utility classes. Have that Filter that autopopulates, check for correct types like Struts. 3. tile framework You can use it without Struts 4. auto-population framework It should be easy to add a Filter that autopopulates a configured form (not every time but as a standard). 5. role based actions I'm not sure what this is. 6. xml configuration of all the links or actions of your application So does web.xml i guess. 7. best practices framework bundling (scaffolding) complete with examples (many years of experience went into this one). Same thing as above. There are tutorials, examples, etc... 8. ease of use If you think of a Servlet as an Action its kind of as easy. Except for some repetative tasks that I would include to complete the servlet spec (rather than rewrite some of the container functionality to add those utils). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 8:42 AM To: Struts Users Mailing List Subject: Re: Struts MVC framework similar to that of a servlet container? Sandeep, You mentioned role based actions in your list... which has caught my eye. Can you please elaborate on this ? Or point me to some documentation ? thanks -raj Sandeep Takhar [EMAIL PROTECTED]To: Struts Users Mailing List [EMAIL PROTECTED] ahoo.comcc: Subject: Re: Struts MVC framework similar to that of a servlet container? 21/07/2003 06:08 PM Please respond to Struts Users Mailing List there's a lot of stuff it gives you out of the box. 1. solid code 2. validation framework 3. tile framework 4. auto-population framework 5. role based actions 6. xml configuration of all the links or actions of your application 7. best practices framework bundling (scaffolding) complete with examples (many years of experience went into this one). 8. ease of use I am missing about twice as many things from this list I am sure... the servlet container is sun's way of making sure that what you build is timeless (and works on their servers...) Struts solves common problems across every typical application. The servlet container does not solve these typical problems. Struts is really a pattern... sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: Hi. I've been using Struts for a long time, and I've been very happy with the framework. However, a recent discussion on Sun's Java forums has left me wondering if Struts is necessary. It seems that the servlet container itself provides an MVC framework very similar to that of Struts. All that is missing is some utilities and standardization. I was wondering if there is a flaw in my logic below, and if anyone had any comments. In comparing these two MVC frameworks, the servlet container would be the equivalent of the ActionServlet. They both read their configuration files, examine the incoming URL, and then forward the request to the configured handler. In the case of the servlet container the handlers are Servlet classes, and in
Re: A column consisting of html:select widgets
Thanks Amit. And that's exactly what i'm doing! Still i fails to show the correct option for the dropdowns. Are you sure its available in struts 1.0? moreover, is my approach to define String[] getter/setter is correct? ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:58 AM Subject: RE: A column consisting of html:select widgets Atta, In your JSP page do the following html:select property=item html:options collection=myOptions property=value labelProperty=label/ /html:select Where the collection myOptions is a List of beans. Those beans have two fields value and label Hope that helps! -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:46 PM To: Struts Users Mailing List Subject: A column consisting of html:select widgets Dear All, I'm using struts 1.0.2. I have a requirement where i need to show a column consisting of dropdown lists. Every row of the table for the column shows a dropdown with the same list of options. I've used String[] getCategory() and setCategory(String[]) getter/setter in thr ActionForm. On the form submission i get the correct selected values for all the rows. Now my questions is how do I set the values of these dropdown from he database when the page is shown for the very first time. I've tried setCategory(String[]) setter, but the dropdowns don't show the correct option selected! I've also tried to search from the mail archive to no avail. Any help or pointers would be greatly appreciated. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Use ApplicationRessources.properties values in html:options value=.... tag
this doesn't work because of the xml specification (cannot embed xml like this) Have to use el or scriptlet instead. sandeep --- Dirk Behrendt [EMAIL PROTECTED] wrote: Hello! I want to use some values from the properties file in my JSP page. ApplicationRessources.properties file: language.german = Deutsch language.english = Englisch Normally such values are used within a JSP page like this: bean:message key= language.german / But how I can use this value within a html:options value= tag? html:options value=bean:message key= language.german / does not work. Dirk __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: A column consisting of html:select widgets
Atta, Can you post the relevant code both JSP and Java objects for us to look at and point you in the right direction? Thanks, Amit -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 1:27 PM To: Struts Users Mailing List Subject: Re: A column consisting of html:select widgets Thanks Amit. And that's exactly what i'm doing! Still i fails to show the correct option for the dropdowns. Are you sure its available in struts 1.0? moreover, is my approach to define String[] getter/setter is correct? ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:58 AM Subject: RE: A column consisting of html:select widgets Atta, In your JSP page do the following html:select property=item html:options collection=myOptions property=value labelProperty=label/ /html:select Where the collection myOptions is a List of beans. Those beans have two fields value and label Hope that helps! -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:46 PM To: Struts Users Mailing List Subject: A column consisting of html:select widgets Dear All, I'm using struts 1.0.2. I have a requirement where i need to show a column consisting of dropdown lists. Every row of the table for the column shows a dropdown with the same list of options. I've used String[] getCategory() and setCategory(String[]) getter/setter in thr ActionForm. On the form submission i get the correct selected values for all the rows. Now my questions is how do I set the values of these dropdown from he database when the page is shown for the very first time. I've tried setCategory(String[]) setter, but the dropdowns don't show the correct option selected! I've also tried to search from the mail archive to no avail. Any help or pointers would be greatly appreciated. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts MVC framework similar to that of a servlet container?
The fact is that the Servlet spec does not provide equivalent features to Struts. Struts wouldn't exist if the Servlet spec already had everything web developers needed. Ok, so Struts started with providing ActionServlet which forwards requests to handlers (Actions) based on its configuration file and the URL. But the container already forwarded requests to handlers (Servlets) basd on its configuration file and the URL. That's what I'm struggling with. It seems like the container,was lets say, 70% of the way there. A lot of functionality that Struts provide can be separate from its controller pieces. I guess we all think of a Servlet as an application entry point rather than just a handler equivalent to a Struts Action. I'm wondering why can't or shouldn't we think of the Servlet as an Action (with understanding that some utilities like form population, etc would need to be added there). ranko -Original Message- From: Adam Levine [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:49 PM To: [EMAIL PROTECTED] Subject: RE: Struts MVC framework similar to that of a servlet container? for my $0.02. Using just pure servlet and base JSP, dealing with forms is not intuitive or clean. You either rely on too much code in a JSP, or too much reading and parsing at the start of your servlets. And, the development cycle increases as your changes increase. I find the Struts mode to be clean and simple. Need to change a field, add a field. Change one class (the ActionForm, or not at all with a dynaform), modify the .jsp presentation. And then account for the field change in the business logic. Combine it with XDoclet, and you've got immediate Data/Value Objects that can be generated from the ActionForm itself, ready to be passed back to your EJB level code (using CMP, you never have to account for the field in the logic, unless you're doing business level decisions). The mechanisms in place for detailing messages back to the user (ie, ActionErrors) are very clean, easly integrated with field-specific messages. Seamless integration with Java's i18n functionality. I'm looking for the reasons why this would not be the case. Are you looking for where using the base Sevlet layer is more advantageous over using Struts? Or, are you looking for areas that Struts just doesn't handle, leaving a gaping hole? Are you being persnickity, or is there a serious question/concern ? From: Ranko Bijelonic [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: Struts MVC framework similar to that of a servlet container? Date: Mon, 21 Jul 2003 12:38:22 -0400 Yes Struts does definitely solve many problems and make it easier. But is seems that it solves a lot of problems that are already solved. I'm looking for the reasons why this would not be the case. Thanks for the help, ranko -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:21 AM To: Struts Users Mailing List Subject: RE: Struts MVC framework similar to that of a servlet container? I guess the main difference between what you mention and struts is that you can use this stuff right away for the app you want to build without modification. As long as you understand the concepts you can apply them. Similar to how you understand a servlet/filter spec. Now you have common problems solved. You don't have to code them or copy and paste from somewhere. You also have the ability to auto-populate to lists which is pretty neat. sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: there's a lot of stuff it gives you out of the box. 1. solid code so does the container i guess. 2. validation framework This is one of those changes that could be added by way of utility classes. Have that Filter that autopopulates, check for correct types like Struts. 3. tile framework You can use it without Struts 4. auto-population framework It should be easy to add a Filter that autopopulates a configured form (not every time but as a standard). 5. role based actions I'm not sure what this is. 6. xml configuration of all the links or actions of your application So does web.xml i guess. 7. best practices framework bundling (scaffolding) complete with examples (many years of experience went into this one). Same thing as above. There are tutorials, examples, etc... 8. ease of use If you think of a Servlet as an Action its kind of as easy. Except for some repetative tasks that I would include to complete the servlet spec (rather than rewrite some of the container functionality to add those utils). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 8:42 AM
Putting to HashMap within ActionForm
A ActionForm can get values from a HashMap using html:text property=myHashMap(myKey)/, but does'nt put them back when the form is posted? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts MVC framework similar to that of a servlet container?
If you've built it already, then you've defeated part of the purpose of adopting it, but not all. I don't understand when you say you want to re-write the servlet spec. Maybe you meant, why isn't it in the servlet spec? Java Server Faces may very well replace (now I'm in trouble...) struts in the long run. And this is a standard. Struts addresses a shortcoming and continues to do so. sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: ok. assume i go through the process below. now i have RANKo framework :) (which I did actually). Then I learn about Struts and say, hey this serves the same function as my framework, let me switch to that cause everybody uses that so its standardized in some way. Then, some time later you realize (perhaps wrongly) that it duplicates a lot of servlet container functionality and that the MVC part of this framework is already there. That's why I'm asking myself how is writing a Servlet different from writing an Action. For every Action in a Struts application I can write a Servlet. Instead of putting my mappings in struts-config.xml, I will put them in web.xml. Now, I know there is some other common code that is currently not in the servlet spec, but is in Struts. My question was is it better to add some of those to the servlet spec, rahter than rewriting part of it. Or, second scenario. Let say I'm using Struts. Then I write an Action that manages these Task objects. I have a configuration file for different Task objects. I write an abstract Task class which different Tasks can extend. My Action is the controller for all the Tasks. I figure out which task to call examining the URL. Over time, I add to this framework to make it easier to use. So now i have a task-config.xml where I specify all my Tasks. I have TaskAction (a controller). And bunch of 'utility code'. Then I ask myself, is this that much different from the Actions Struts provides? Note that I'm not necessarily saying this is the case, just asking for some reasons why that is not the case. General information about frameworks and how they come about does not address the specific question of wheter this particular framework duplicates a lot of functionality of its parent environment. Either way, thanks for trying :). ranko -Original Message- From: Navjot Singh [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:28 AM To: Struts Users Mailing List Subject: RE: Struts MVC framework similar to that of a servlet container? hi ranko, Assume you don't use struts. You start writing your first app for your requirements. Being an expert programmer, you have done with first one by wriitng lots of utility classes and base code. Now you start with second. You will realize that the second app can use most of the functionality (except business logic) from the first app. NOW WHAT? You will dig out some code from first app that can be RE-USED in second app. That code can be called a framework(;et's call it RANKo framework ;-) and that's precisely what STRUTS intends to provide. Anyway, it's your viewpoint. Being a creator of one servlet/xml/xslt based framework myself(almost 18 months back), I know what is *common code* required for *most of the apps* and the efforts/time needed to create that framework. So, when starting with an app, i can find and USE as good framework as STRUTS, nothing like that. I don't say STRUTS is good enough, you may have diff requirements altogether so struts may not be the best choice for you. You write on your own but it's always good to look around for good frameworks and build ON TOP OF THEM. hope it clears. still i am trying to give answers to few of the individual points below. -navjot | 1. solid code |so does the container i guess. true but container gives you world of choice. Struts gives you the base code for *common* requirements. So, you save time writing on *that common* code. |2. validation framework |This is one of those changes that could be added by way of utility classes. |Have that Filter that autopopulates, check for correct types like Struts. Agreed. |3. tile framework |You can use it without Struts Struts also does not enforce any fix presentation model. Could be xslt/velocity/jsp any. | 4. auto-population framework |It should be easy to add a Filter that autopopulates a configured form (not |every time but as a standard). | | 5. role based actions |I'm not sure what this is. Same as roles in servlet specs but checking is deferred per action. |6. xml configuration of all the links or actions of |your application So does web.xml i guess. but here it is module based config. easy of maintenance ;-) |7. best practices framework bundling (scaffolding)complete with examples (many years of experience went |into this one). |Same thing as above. There are tutorials, examples, etc...
RE: Using the validator for client side field modifications
Yes. Struts Validator comes with only the basic type validation. You can extend it both on the server side and client side(in your case). -Original Message- From: Gregory F. March [mailto:[EMAIL PROTECTED] Sent: July 21, 2003 12:07 PM To: Struts Users Mailing List Subject: Re: Using the validator for client side field modifications In which case, I can create custom validation rules for fields with my own custom javascript and they will be inserted as well? As in: onBlur=validateAllUppercase() Thanks, /greg -- Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Accessing Page Scope Var in Scriptlet
use item sandeep --- Hunter Hillegas [EMAIL PROTECTED] wrote: When I use nested:iterate as such: nested:iterate id=item property=lineItems indexId=lineItemCount I get a page scope variable called 'lineItemCount'. I have a need to use that variable in a scriptlet (I know, I know...). I tried this: calendarCountID.add(lineItemCount); (calendarCountID is a Vector) but this doesn't work. How can I access this? Thanks in advance, Hunter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: A column consisting of html:select widgets
okay, here goes my JSP code: REPATE FOR ALL THE BLOCKS html:select property=blockDataSource style=WIDTH: 110px; font-size: 8pt onchange=blockDataSourceChanged(); html:options collection=blockDataSourceList property=value labelProperty=label/ /html:select END REPEAT The blockDataSourceList is an ArrayList of LabelValueBean class and is in the session scope. On the page load, I'm setting Form.setBlockDataSource(String[]) to appropriate string array represneting the saved value for the row. My dropdowns always show the first option selected. Thanks for the help. ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:30 AM Subject: RE: A column consisting of html:select widgets Atta, Can you post the relevant code both JSP and Java objects for us to look at and point you in the right direction? Thanks, Amit -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 1:27 PM To: Struts Users Mailing List Subject: Re: A column consisting of html:select widgets Thanks Amit. And that's exactly what i'm doing! Still i fails to show the correct option for the dropdowns. Are you sure its available in struts 1.0? moreover, is my approach to define String[] getter/setter is correct? ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:58 AM Subject: RE: A column consisting of html:select widgets Atta, In your JSP page do the following html:select property=item html:options collection=myOptions property=value labelProperty=label/ /html:select Where the collection myOptions is a List of beans. Those beans have two fields value and label Hope that helps! -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:46 PM To: Struts Users Mailing List Subject: A column consisting of html:select widgets Dear All, I'm using struts 1.0.2. I have a requirement where i need to show a column consisting of dropdown lists. Every row of the table for the column shows a dropdown with the same list of options. I've used String[] getCategory() and setCategory(String[]) getter/setter in thr ActionForm. On the form submission i get the correct selected values for all the rows. Now my questions is how do I set the values of these dropdown from he database when the page is shown for the very first time. I've tried setCategory(String[]) setter, but the dropdowns don't show the correct option selected! I've also tried to search from the mail archive to no avail. Any help or pointers would be greatly appreciated. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts MVC framework similar to that of a servlet container?
--- Ranko Bijelonic [EMAIL PROTECTED] wrote: The fact is that the Servlet spec does not provide equivalent features to Struts. Struts wouldn't exist if the Servlet spec already had everything web developers needed. Ok, so Struts started with providing ActionServlet which forwards requests to handlers (Actions) based on its configuration file and the URL. But the container already forwarded requests to handlers (Servlets) basd on its configuration file and the URL. That's what I'm struggling with. It seems like the container,was lets say, 70% of the way there. A lot of functionality that Struts provide can be separate from its controller pieces. I guess we all think of a Servlet as an application entry point rather than just a handler equivalent to a Struts Action. I'm wondering why can't or shouldn't we think of the Servlet as an Action (with understanding that some utilities like form population, etc would need to be added there). You could certainly code each Action as a Servlet but it would take more work. You've mentioned changing the Servlet spec several times and seem to be under the impression that it's easy to do. Open source software has certain advantages over standards because it is easier to try new things. It's *much* easier to change Struts than to change any Java specification including Servlets. But you should notice the huge influence OSS and Struts in particular has had over the standard technologies. Struts directly contributed to JSF and JSTL with ideas and pressure to make the standards better than the Struts version. IMO, that's a much more effective way of changing things for the better. David ranko -Original Message- From: Adam Levine [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:49 PM To: [EMAIL PROTECTED] Subject: RE: Struts MVC framework similar to that of a servlet container? for my $0.02. Using just pure servlet and base JSP, dealing with forms is not intuitive or clean. You either rely on too much code in a JSP, or too much reading and parsing at the start of your servlets. And, the development cycle increases as your changes increase. I find the Struts mode to be clean and simple. Need to change a field, add a field. Change one class (the ActionForm, or not at all with a dynaform), modify the .jsp presentation. And then account for the field change in the business logic. Combine it with XDoclet, and you've got immediate Data/Value Objects that can be generated from the ActionForm itself, ready to be passed back to your EJB level code (using CMP, you never have to account for the field in the logic, unless you're doing business level decisions). The mechanisms in place for detailing messages back to the user (ie, ActionErrors) are very clean, easly integrated with field-specific messages. Seamless integration with Java's i18n functionality. I'm looking for the reasons why this would not be the case. Are you looking for where using the base Sevlet layer is more advantageous over using Struts? Or, are you looking for areas that Struts just doesn't handle, leaving a gaping hole? Are you being persnickity, or is there a serious question/concern ? From: Ranko Bijelonic [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: Struts MVC framework similar to that of a servlet container? Date: Mon, 21 Jul 2003 12:38:22 -0400 Yes Struts does definitely solve many problems and make it easier. But is seems that it solves a lot of problems that are already solved. I'm looking for the reasons why this would not be the case. Thanks for the help, ranko -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:21 AM To: Struts Users Mailing List Subject: RE: Struts MVC framework similar to that of a servlet container? I guess the main difference between what you mention and struts is that you can use this stuff right away for the app you want to build without modification. As long as you understand the concepts you can apply them. Similar to how you understand a servlet/filter spec. Now you have common problems solved. You don't have to code them or copy and paste from somewhere. You also have the ability to auto-populate to lists which is pretty neat. sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: there's a lot of stuff it gives you out of the box. 1. solid code so does the container i guess. 2. validation framework This is one of those changes that could be added by way of utility classes. Have that Filter that autopopulates, check for correct types like Struts. 3. tile framework You can use it without Struts 4. auto-population
RE: Struts MVC framework similar to that of a servlet container?
yes, Java Server Faces provides a different programing model from that of Struts. Its also an MVC framework, but is more Swing like (or ASP.NET like :)). This kind of programing might win over a lots of developers. But in map a request to a handler a dispatch the request to it point of view, we still have Struts and the servlet container itself :). -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 2:39 PM To: Struts Users Mailing List Subject: RE: Struts MVC framework similar to that of a servlet container? If you've built it already, then you've defeated part of the purpose of adopting it, but not all. I don't understand when you say you want to re-write the servlet spec. Maybe you meant, why isn't it in the servlet spec? Java Server Faces may very well replace (now I'm in trouble...) struts in the long run. And this is a standard. Struts addresses a shortcoming and continues to do so. sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: ok. assume i go through the process below. now i have RANKo framework :) (which I did actually). Then I learn about Struts and say, hey this serves the same function as my framework, let me switch to that cause everybody uses that so its standardized in some way. Then, some time later you realize (perhaps wrongly) that it duplicates a lot of servlet container functionality and that the MVC part of this framework is already there. That's why I'm asking myself how is writing a Servlet different from writing an Action. For every Action in a Struts application I can write a Servlet. Instead of putting my mappings in struts-config.xml, I will put them in web.xml. Now, I know there is some other common code that is currently not in the servlet spec, but is in Struts. My question was is it better to add some of those to the servlet spec, rahter than rewriting part of it. Or, second scenario. Let say I'm using Struts. Then I write an Action that manages these Task objects. I have a configuration file for different Task objects. I write an abstract Task class which different Tasks can extend. My Action is the controller for all the Tasks. I figure out which task to call examining the URL. Over time, I add to this framework to make it easier to use. So now i have a task-config.xml where I specify all my Tasks. I have TaskAction (a controller). And bunch of 'utility code'. Then I ask myself, is this that much different from the Actions Struts provides? Note that I'm not necessarily saying this is the case, just asking for some reasons why that is not the case. General information about frameworks and how they come about does not address the specific question of wheter this particular framework duplicates a lot of functionality of its parent environment. Either way, thanks for trying :). ranko -Original Message- From: Navjot Singh [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:28 AM To: Struts Users Mailing List Subject: RE: Struts MVC framework similar to that of a servlet container? hi ranko, Assume you don't use struts. You start writing your first app for your requirements. Being an expert programmer, you have done with first one by wriitng lots of utility classes and base code. Now you start with second. You will realize that the second app can use most of the functionality (except business logic) from the first app. NOW WHAT? You will dig out some code from first app that can be RE-USED in second app. That code can be called a framework(;et's call it RANKo framework ;-) and that's precisely what STRUTS intends to provide. Anyway, it's your viewpoint. Being a creator of one servlet/xml/xslt based framework myself(almost 18 months back), I know what is *common code* required for *most of the apps* and the efforts/time needed to create that framework. So, when starting with an app, i can find and USE as good framework as STRUTS, nothing like that. I don't say STRUTS is good enough, you may have diff requirements altogether so struts may not be the best choice for you. You write on your own but it's always good to look around for good frameworks and build ON TOP OF THEM. hope it clears. still i am trying to give answers to few of the individual points below. -navjot | 1. solid code |so does the container i guess. true but container gives you world of choice. Struts gives you the base code for *common* requirements. So, you save time writing on *that common* code. |2. validation framework |This is one of those changes that could be added by way of utility classes. |Have that Filter that autopopulates, check for correct types like Struts. Agreed. |3. tile framework |You can use it without Struts Struts also does not enforce any fix presentation model. Could be xslt/velocity/jsp any. | 4. auto-population framework |It should be easy to add a Filter that
Struts article at Apple developer site
Just noticed this article at the developer section of apple.com. I haven't read it in detail yet, but skimming it, seemed to show that it's a nice introductory article. Perhaps, even suitable for non-apple developers. http://developer.apple.com/internet/java/struts.html Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 Never give in - never, never, never, never, in nothing great or small, large or petty, never give in except to convictions of honor and good sense. - Sir Winston Churchill - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Building Dynamic Tables with DyanValidatorForms
Can anyone help? I have been trying to build a dynamic table using a DynaValidatorForm as my form. I am having trouble. I have javascript code to dyanmically add rows to the table but when I hit the submit button, the form does not contain these new rows. I don't know how to get these new rows into the form in the jsp file. Can anyone help explain how this might happen? Here is a snipet of my code: form-bean name=reviewRecordForm type=prtr.forms.ReviewRecordForm dynamic=true form-property name=reviewRecId type=java.lang.Long/ form-property name=projectRevId type=java.lang.Long/ form-property name=recordType type=java.lang.String/ form-property name=date type=java.lang.String/ form-property name=trNumber type=java.lang.String/ form-property name=scNumber type=java.lang.String/ form-property name=crNumber type=java.lang.String/ form-property name=reviewTitle type=java.lang.String/ form-property name=productTitle type=java.lang.String/ form-property name=productNumber type=java.lang.String/ form-property name=module type=java.lang.String/ form-property name=sizes type=prtr.data.DTO.TextValueBean[]/ form-property name=disposition type=prtr.data.DTO.OptionsBean/ form-property name=times type=prtr.data.DTO.MeetingTimesBean[]/ form-property name=meetingTimes type=prtr.data.DTO.MeetingTimesDTO[]/ form-property name=timesList type=java.util.ArrayList/ form-property name=id type=java.lang.String[]/ form-property name=time type=java.lang.String[]/ form-property name=meetingAttendees type=prtr.data.DTO.MeetingAttendeesDTO[]/ /form-bean jsp code: !-- Meeting Table -- table width=75% border=1 id=meetingTimesTable tr th valign=top colspan=2 align=center bgcolor=#CC nowrapMeetings/th /tr c:forEach var=times items=${reviewRecordForm.map.times} tr tdMeeting html:text indexed=true name=times property=id/ /td tdElapsed Time html:text indexed=true name=times property=time/ /td /tr /c:forEach /table br input type=button name=addRow value=Add Row onClick=insertTableRow('meetingTimesTable') javascript code: script type=text/javascript var TDCount = 0; function insertTableRow(id) { var table = document.getElementById(id); // get number of current rows var rowItems = table.getElementsByTagName(tr); var rowCount = rowItems.length; // insert the new row var newRow = table.insertRow(rowCount); // get count of cells for the last row (so we know how many to insert) var cellItems = rowItems[rowCount-1].getElementsByTagName(td); var cellCount = cellItems.length; // loop over the children of the last set of cells for (i=0; icellCount; i++) { // insert an analagous cell var cell = newRow.insertCell(i); // get the children of each cell var kids = cellItems[i].childNodes; for (j=0; jkids.length; j++) { var newChild = kids[j].cloneNode(true); // copy data into this cell cell.appendChild(newChild); } } } /script action code: //debug MeetingTimesBean[] newList = (MeetingTimesBean[])reviewRecordForm.get(times); System.out.println(newlist size is + newList.length); java.util.ArrayList newListAsArrayList = new java.util.ArrayList(java.util.Arrays.asList((MeetingTimesBean[])reviewRecordForm.get(times))); System.out.println(newList is + newListAsArrayList); When I print this, I always get only one line (the first row which I put in there as a default). If anyone can help I would appreciate it. I have been working on this several days and I am stumpped. Natalie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: A column consisting of html:select widgets
Have you tried using a separate ViewAction for the display and a SubmitAction for the submittal.The ViewAction could populate the data from the DB and set multiple selected values depending on the values in the DB. Vijay -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:27 AM To: Struts Users Mailing List Subject: Re: A column consisting of html:select widgets Thanks Amit. And that's exactly what i'm doing! Still i fails to show the correct option for the dropdowns. Are you sure its available in struts 1.0? moreover, is my approach to define String[] getter/setter is correct? ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:58 AM Subject: RE: A column consisting of html:select widgets Atta, In your JSP page do the following html:select property=item html:options collection=myOptions property=value labelProperty=label/ /html:select Where the collection myOptions is a List of beans. Those beans have two fields value and label Hope that helps! -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:46 PM To: Struts Users Mailing List Subject: A column consisting of html:select widgets Dear All, I'm using struts 1.0.2. I have a requirement where i need to show a column consisting of dropdown lists. Every row of the table for the column shows a dropdown with the same list of options. I've used String[] getCategory() and setCategory(String[]) getter/setter in thr ActionForm. On the form submission i get the correct selected values for all the rows. Now my questions is how do I set the values of these dropdown from he database when the page is shown for the very first time. I've tried setCategory(String[]) setter, but the dropdowns don't show the correct option selected! I've also tried to search from the mail archive to no avail. Any help or pointers would be greatly appreciated. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:write and the format attribute
I'm having a little bit of trouble using the format attribute in bean:write. I'm trying to use the FormatStyles as documented in java.text.MessageFormat. bean:write ... format={0, number, currency}/ and bean:write ... format={0, date, long}/ But these are not working. Is this not supported, or am I doing something wrong? (final 1.1 release). -TPP - This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question on how to remove a detail row?
Hi, I have the following code.. It prints out a remove button on each row.. How do I determine on which row the remove button was pressed? c:forEach items=${OptimizerInputFormBean.constraints} var=constraint varStatus=iter tr tdc:out value=${constraint.type}//td tdc:out value=${constraint.shares}//td tdc:out value=${constraint.lowerBound}//td tdc:out value=${constraint.upperBound}//td tdc:out value=${iter.count}//td tdhtml:submit property=submit value=removeConstraint/html:submit/td /tr /c:forEach -- 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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts MVC framework similar to that of a servlet container?
You could certainly code each Action as a Servlet but it would take more work. I'm not sure exactely how it would take more work (provided there were Struts like utils writen one time). You've mentioned changing the Servlet spec several times and seem to be under the impression that it's easy to do. Open source software has certain advantages over standards because it is easier to try new things. It's *much* easier to change Struts than to change any Java specification including Servlets. But you should notice the huge influence OSS and Struts in particular has had over the standard technologies. Struts directly contributed to JSF and JSTL with ideas and pressure to make the standards better than the Struts version. IMO, that's a much more effective way of changing things for the better. Yes, that is true. We definitely benefited from Struts in many ways. But it just seems to be getting too encompasing. Now we have declarative exception handling that is configured in struts-config.xml, and we have it ( a weaker version maybe) in web.xml. Struts is becoming kind of self sufficient where everything is done through it even if it already can be done through something else. Its like a little container itself. But maybe i'm just temporarily mad :). ranko ranko -Original Message- From: Adam Levine [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:49 PM To: [EMAIL PROTECTED] Subject: RE: Struts MVC framework similar to that of a servlet container? for my $0.02. Using just pure servlet and base JSP, dealing with forms is not intuitive or clean. You either rely on too much code in a JSP, or too much reading and parsing at the start of your servlets. And, the development cycle increases as your changes increase. I find the Struts mode to be clean and simple. Need to change a field, add a field. Change one class (the ActionForm, or not at all with a dynaform), modify the .jsp presentation. And then account for the field change in the business logic. Combine it with XDoclet, and you've got immediate Data/Value Objects that can be generated from the ActionForm itself, ready to be passed back to your EJB level code (using CMP, you never have to account for the field in the logic, unless you're doing business level decisions). The mechanisms in place for detailing messages back to the user (ie, ActionErrors) are very clean, easly integrated with field-specific messages. Seamless integration with Java's i18n functionality. I'm looking for the reasons why this would not be the case. Are you looking for where using the base Sevlet layer is more advantageous over using Struts? Or, are you looking for areas that Struts just doesn't handle, leaving a gaping hole? Are you being persnickity, or is there a serious question/concern ? From: Ranko Bijelonic [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: Struts MVC framework similar to that of a servlet container? Date: Mon, 21 Jul 2003 12:38:22 -0400 Yes Struts does definitely solve many problems and make it easier. But is seems that it solves a lot of problems that are already solved. I'm looking for the reasons why this would not be the case. Thanks for the help, ranko -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:21 AM To: Struts Users Mailing List Subject: RE: Struts MVC framework similar to that of a servlet container? I guess the main difference between what you mention and struts is that you can use this stuff right away for the app you want to build without modification. As long as you understand the concepts you can apply them. Similar to how you understand a servlet/filter spec. Now you have common problems solved. You don't have to code them or copy and paste from somewhere. You also have the ability to auto-populate to lists which is pretty neat. sandeep --- Ranko Bijelonic [EMAIL PROTECTED] wrote: there's a lot of stuff it gives you out of the box. 1. solid code so does the container i guess. 2. validation framework This is one of those changes that could be added by way of utility classes. Have that Filter that autopopulates, check for correct types like Struts. 3. tile framework You can use it without Struts 4. auto-population framework It should be easy to add a Filter that autopopulates a configured form (not every time but as a standard). 5. role based actions I'm not sure what this is. 6. xml configuration of all the links or actions of your application So does web.xml i guess. 7. best practices framework bundling (scaffolding) complete with examples (many years of experience
RE: Question on how to remove a detail row?
You could generate an onclick eventhandler for each button, parameterized with the record ID, or some other data. Then when the button is clicked, it can set a parameter (or hidden form field) that identifies the row. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 3:07 PM To: 'Struts Users Mailing List' Subject: Question on how to remove a detail row? Hi, I have the following code.. It prints out a remove button on each row.. How do I determine on which row the remove button was pressed? c:forEach items=${OptimizerInputFormBean.constraints} var=constraint varStatus=iter tr tdc:out value=${constraint.type}//td tdc:out value=${constraint.shares}//td tdc:out value=${constraint.lowerBound}//td tdc:out value=${constraint.upperBound}//td tdc:out value=${iter.count}//td tdhtml:submit property=submit value=removeConstraint/html:submit/td /tr /c:forEach -- 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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: A column consisting of html:select widgets
Thanks Vijay. That's is an excellent idea to separate the view and submittal logic. But i'm not yet sure if struts can automatically select the appropriate selection in a dropdown based on the arry of strings from the form object. ATTA - Original Message - From: Vijay Balakrishnan [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:00 PM Subject: RE: A column consisting of html:select widgets Have you tried using a separate ViewAction for the display and a SubmitAction for the submittal.The ViewAction could populate the data from the DB and set multiple selected values depending on the values in the DB. Vijay -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:27 AM To: Struts Users Mailing List Subject: Re: A column consisting of html:select widgets Thanks Amit. And that's exactly what i'm doing! Still i fails to show the correct option for the dropdowns. Are you sure its available in struts 1.0? moreover, is my approach to define String[] getter/setter is correct? ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:58 AM Subject: RE: A column consisting of html:select widgets Atta, In your JSP page do the following html:select property=item html:options collection=myOptions property=value labelProperty=label/ /html:select Where the collection myOptions is a List of beans. Those beans have two fields value and label Hope that helps! -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:46 PM To: Struts Users Mailing List Subject: A column consisting of html:select widgets Dear All, I'm using struts 1.0.2. I have a requirement where i need to show a column consisting of dropdown lists. Every row of the table for the column shows a dropdown with the same list of options. I've used String[] getCategory() and setCategory(String[]) getter/setter in thr ActionForm. On the form submission i get the correct selected values for all the rows. Now my questions is how do I set the values of these dropdown from he database when the page is shown for the very first time. I've tried setCategory(String[]) setter, but the dropdowns don't show the correct option selected! I've also tried to search from the mail archive to no avail. Any help or pointers would be greatly appreciated. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Error Using select tag To Create Drop-Down Menu
I am doing testings step by step. I simply want to add a drop-down menu feature to something that works OKay. I am a newbie to struts. I do not know where to look for my mistakes when I encounter problems. Something is wrong in my .jsp page. This .jsp page had worked fine before html:select.../html:select tags were added. The error message is: code: -- 2003-07-21 01:24:51 StandardWrapperValve[action]:Servlet.service() for servlet action threw exceptionorg.apache.jasper.JasperException: Cannot find bean under name org.apache.struts.taglib.html.BEAN --- Here is the source code of my MainMenu.jsp: code: --- %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % jsp:useBean id=LogonBean scope=request class=resources.version1.LogonBean / HTML HEAD TITLEbean:message key=title.mainmenu / /TITLE /HEAD BODY bean:message key=heading.mainmenu / p bean:message key=label.userType /: bjsp:getProperty name=LogonBean property=userType //b br BState: /B html:select property=state html:options collection=STATES property=value labelProperty=label / /html:select /BODY /HTML --- In the LogonBean.java, I inserted in the setParameters() method the following code: code: --- public void setParameters( HttpServletRequest request ){ userID = request.getParameter(userID); password = request.getParameter(password); ArrayList states = new ArrayList(); states.add(new LabelValueBean(Virginia, VA)); states.add(new LabelValueBean(Maryland, MD)); states.add(new LabelValueBean(Ohio, OH)); states.add(new LabelValueBean(Rode Island, RI)); states.add(new LabelValueBean(New York, NY)); request.setAttribute(STATES, states);} -- I would appreciate if anybody could point out my mistakes. __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: A column consisting of html:select widgets
Okay I see what you are trying to do. Here is a suggestion from the top of my head: Create a new action class which uses the same form as the Action in question (populateDataSourceAction or something...). Use this class to load the data from the DB into the blockDataSource field in the form. Put the form in the request space like this in the Action: aRequest.setAttribute(anActionMapping.getName(), myActionForm) then forward it to the JSP page. Do not do any funky javascript stuff (onLoad etc etc) It should work without it!! --Amit -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 1:52 PM To: Struts Users Mailing List Subject: Re: A column consisting of html:select widgets okay, here goes my JSP code: REPATE FOR ALL THE BLOCKS html:select property=blockDataSource style=WIDTH: 110px; font-size: 8pt onchange=blockDataSourceChanged(); html:options collection=blockDataSourceList property=value labelProperty=label/ /html:select END REPEAT The blockDataSourceList is an ArrayList of LabelValueBean class and is in the session scope. On the page load, I'm setting Form.setBlockDataSource(String[]) to appropriate string array represneting the saved value for the row. My dropdowns always show the first option selected. Thanks for the help. ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:30 AM Subject: RE: A column consisting of html:select widgets Atta, Can you post the relevant code both JSP and Java objects for us to look at and point you in the right direction? Thanks, Amit -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 1:27 PM To: Struts Users Mailing List Subject: Re: A column consisting of html:select widgets Thanks Amit. And that's exactly what i'm doing! Still i fails to show the correct option for the dropdowns. Are you sure its available in struts 1.0? moreover, is my approach to define String[] getter/setter is correct? ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:58 AM Subject: RE: A column consisting of html:select widgets Atta, In your JSP page do the following html:select property=item html:options collection=myOptions property=value labelProperty=label/ /html:select Where the collection myOptions is a List of beans. Those beans have two fields value and label Hope that helps! -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:46 PM To: Struts Users Mailing List Subject: A column consisting of html:select widgets Dear All, I'm using struts 1.0.2. I have a requirement where i need to show a column consisting of dropdown lists. Every row of the table for the column shows a dropdown with the same list of options. I've used String[] getCategory() and setCategory(String[]) getter/setter in thr ActionForm. On the form submission i get the correct selected values for all the rows. Now my questions is how do I set the values of these dropdown from he database when the page is shown for the very first time. I've tried setCategory(String[]) setter, but the dropdowns don't show the correct option selected! I've also tried to search from the mail archive to no avail. Any help or pointers would be greatly appreciated. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is
RE: Question on how to remove a detail row?
I prefer non-javascript if possible? -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 3:12 PM To: Struts Users Mailing List Subject: RE: Question on how to remove a detail row? You could generate an onclick eventhandler for each button, parameterized with the record ID, or some other data. Then when the button is clicked, it can set a parameter (or hidden form field) that identifies the row. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 3:07 PM To: 'Struts Users Mailing List' Subject: Question on how to remove a detail row? Hi, I have the following code.. It prints out a remove button on each row.. How do I determine on which row the remove button was pressed? c:forEach items=${OptimizerInputFormBean.constraints} var=constraint varStatus=iter tr tdc:out value=${constraint.type}//td tdc:out value=${constraint.shares}//td tdc:out value=${constraint.lowerBound}//td tdc:out value=${constraint.upperBound}//td tdc:out value=${iter.count}//td tdhtml:submit property=submit value=removeConstraint/html:submit/td /tr /c:forEach -- 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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This 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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Question on how to remove a detail row?
have each row be its own separate form. add a hidden field that indicates which row it's on. read that field on the submit. From: Norr, Peter [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: Question on how to remove a detail row? Date: Mon, 21 Jul 2003 15:21:14 -0400 I prefer non-javascript if possible? -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 3:12 PM To: Struts Users Mailing List Subject: RE: Question on how to remove a detail row? You could generate an onclick eventhandler for each button, parameterized with the record ID, or some other data. Then when the button is clicked, it can set a parameter (or hidden form field) that identifies the row. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 3:07 PM To: 'Struts Users Mailing List' Subject: Question on how to remove a detail row? Hi, I have the following code.. It prints out a remove button on each row.. How do I determine on which row the remove button was pressed? c:forEach items=${OptimizerInputFormBean.constraints} var=constraint varStatus=iter tr tdc:out value=${constraint.type}//td tdc:out value=${constraint.shares}//td tdc:out value=${constraint.lowerBound}//td tdc:out value=${constraint.upperBound}//td tdc:out value=${iter.count}//td tdhtml:submit property=submit value=removeConstraint/html:submit/td /tr /c:forEach -- 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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This 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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Question on how to remove a detail row?
or, for those who aren't fans of having multiple forms. Add checkbox/radio button (Depending on your business logic) to each row, obviously indexed to the row #, and then place one button below the rows labeled delete/removed selected item(s) From: Norr, Peter [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: Question on how to remove a detail row? Date: Mon, 21 Jul 2003 15:21:14 -0400 I prefer non-javascript if possible? -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 3:12 PM To: Struts Users Mailing List Subject: RE: Question on how to remove a detail row? You could generate an onclick eventhandler for each button, parameterized with the record ID, or some other data. Then when the button is clicked, it can set a parameter (or hidden form field) that identifies the row. -Original Message- From: Norr, Peter [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 3:07 PM To: 'Struts Users Mailing List' Subject: Question on how to remove a detail row? Hi, I have the following code.. It prints out a remove button on each row.. How do I determine on which row the remove button was pressed? c:forEach items=${OptimizerInputFormBean.constraints} var=constraint varStatus=iter tr tdc:out value=${constraint.type}//td tdc:out value=${constraint.shares}//td tdc:out value=${constraint.lowerBound}//td tdc:out value=${constraint.upperBound}//td tdc:out value=${iter.count}//td tdhtml:submit property=submit value=removeConstraint/html:submit/td /tr /c:forEach -- 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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This 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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]