Re: Hidden Field in a form. Do I use struts taglib or vanilla html?
Ted, Again this is great information. I think it confirms something I have been struggling with -: I am trying to handle the CANCEL case of an edit a record screen which was arrived at from the previous list of records screen. They use the same formbean which has an action field. When entering the first list of records screen it is set to action=display, and when entering the edit a record screen it is set to edit/add/delete as approrpriate. The reason for this is my formbean validation differs in the two cases (another story). The problem I have is if the use hits CANCEL on the edit a record screen I wanted to send them back to the display list of records screen via the associated action (cf directly to the JSP), ie so that the action sets up appropriate objects required (don't want to recode this). The catch seems to be I need to set the action request parameter back to DISPLAY from say EDIT in the edit a record action prior to forwarding to the display list of records action. It seems this may not be possible?? - setting action element in the form from within the action prior to the forward doesn't work as the pseudo code below indicates that If a form bean is in play, the ActionServlet resets and populates it from the HTTP request - I still haven't found a way to override a request parameters value from an action yet??? (it seems possible using a JSP tag, ie the forward tag, so maybe I just haven't worked it out yet) Other this this maybe I need to re-think the design? :-) Ideas anyone? Cheers Greg Original Message Follows From: Ted Husted [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Hidden Field in a form. Do I use struts taglib or vanilla html? Date: Thu, 29 Nov 2001 14:16:11 -0500 The general order of things is 1) Client requests an Action URI (the path from the ActionMapping) 2) The container passes the request to the ActionServlet 3) The ActionServlet looks up the mapping for the path 4) If the mapping specifies a form bean, the ActionServlet sees if there is one already, or creates one. 4.1) If a form bean is in play, the ActionServlet resets and populates it from the HTTP request 4.2) If the mapping has validate set to true, it calls validate on the form bean. If it fails, it forwards to the path specified by the input property, and this control flow ends 5) If the mapping specifies an Action type, it is instantiated if needed, or reused if already there 5.1) The Action's perform method is called, with the instantiated form bean 5.2) The Action may populate the form bean, call business objects,and do whatever else is needed 5.3) The Action returns an ActionForward to the ActionServlet If the ActionForward is to another Action URI, we begin again, else it's off to a JSP or something. If the ActionForward is to a JSP 1) Jasper, or the equivalent, renders the page 2) If the Struts html tags see the ActionForm in the request (from 4), it populate the controls from the ActionForm. Else the html:form tag creates one, and uses its default values in its tags. (Can't draw, but I sure can number;-) If you just need to create a blank form (4), you can use a continue Action to pass control through an Action and then out to the JSP. public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { return mapping.findForward(request.getParameter(continue)); } So in the mapping you specify the ActionForm for this instance, validate=false, and a local forward for the JSP input form. David Lauta wrote: Thanks for the reply, I understand that you would like me to seperate the UI from the Model Can you be more specific about 'The recommended control flow is to go through an Action first' I'm trying to get a one page does it all UI - Is there a tag I should use to invoke some kind of preprocess action? What I am after is populating the List boxes with data from (ultimately) EJB's I need to decide where I am going to instantiate and initialize my EJB's ( Session Beans ) To this point in my model I have subclassed ActionForm, Action, and ActionMapping my struts-config.xml is: form-beans form-bean name=StrutsTestForm type=web.StrutsTestForm / /form-beans action-mappings action name=StrutsTestForm path=/StrutsTest type=web.StrutsTestAction input=/StrutsTest.jsp attribute=StrutsTestForm forward name=success path=/StrutsTest.jsp / /action /action-mappings Should I be using the ActionFormBean instead or in conjunction with the ActionForm subclass? From the ActionForm I can get the ActionMapping through ActionServlet.findMapping(String) At what point in time is the servlet associated
AW: Hidden Field in a form. Do I use struts taglib or vanilla html?
Ted, a great idea, but you need to know the name of the actionForm in the jsp-Page. If you change the name in the struts-config.xml, you have to change it here, too. Doesn't this hurt struts design principles? Isn't it better (at least until struts 1.1 is released) to have two methods on the actionForm-class, one for the values and one for the values, which internally (i.e. in java-Code) map to a method named getNames? Björn-H. Moritz -Ursprüngliche Nachricht- Von: Ted Husted [SMTP:[EMAIL PROTECTED]] Gesendet am: Donnerstag, 29. November 2001 22:19 An: Struts Users Mailing List Betreff: Re: Hidden Field in a form. Do I use struts taglib or vanilla html? The cleanest thing is to put the ArrayList on the ActionForm. The syntax of the options tag is suboptimal, so you need to expose the property as a bean. html:select property=namesId bean:define id=names name=actionForm property=names type=java.util.Collection/ html:options collection=names property=value labelProperty=label/ /html:select So, you go through an Action, and have it setup the names list. If there's validation involved, use the same Action as the input path, so the list gets made again. This also makes it much easier to retrieve the list from a database or static class that is on the business tier. David Lauta wrote: Wow, Thanks Ted this is great info. I have narrowed my problem down to: I want to use a SELECT Tag on a form and I want the options to be populated when the form is first displayed. To do this I need to set an ArrayList of valueLabel pairs in the page Context pageContext.setAttribute(names, actionForm.getNames()); // getNames returns an ArrayList // each Item in the arrayList has a getValue() and getLabel() accessor. This works but is coded in the JSP ( tightly coupling the UI with the Model ). I'm looking for a way to set the attribute outside of the JSP so that the following will work form:select property=namesId onchange=javascript:submitForm() form:options collection=names property=value labelProperty=label / /form:select In the sequence of events listed below when is the earliest that I can obtain the pageContext to call the setAttribute() method on it. I'm guessing that the PageContext of the JSP is the same as the ServletContext of the HTTPServlet Could my problem be related to I am using the ActionForm instead of the ActionFormBean class? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
How to get ActionForm as input
Hello All, I have a html:form this form can be used to create, read, update and delete a record from a ejb service. Since one form can have only one html:submit / button, I have created all four of these operations as hyperlinks. Now when I click on these links My Action does get executed, but nothing of ActionForm is populated. The reason I guess is that I have not done a Form-submit How can I have the ActionForm populated? I tried giving the input attribute to the actionmapping in struts.config but that did not help. Is it possible that I can have multiple html:submit buttons each pointing to a different action. that way also I can solve my problem. Else there should be some way to populate the Form even when a form.submit was not done. Please help. regards, Abhishek. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How to get ActionForm as input
Hi Abhishek! I think there are some suggestions in the mailing list concering multiple submit buttons (try 'multiple submit'). But why don't you design a selection list in the form for the CRUD-Operations? There you only have to request the concerning selection property value and you can decide where to forward. I have done so in my CRUD-Forms it works very fine. Regards Thomas -Original Message- From : Abhishek Srivastava [EMAIL PROTECTED] To : Struts-User (E-mail) [EMAIL PROTECTED] Date : 30 November 2001 09:34:25 Subject : How to get ActionForm as input Hello All, I have a html:form this form can be used to create, read, update and delete a record from a ejb service. Since one form can have only one html:submit / button, I have created all four of these operations as hyperlinks. Now when I click on these links My Action does get executed, but nothing of ActionForm is populated. The reason I guess is that I have not done a Form-submit How can I have the ActionForm populated? I tried giving the input attribute to the actionmapping in struts.config but that did not help. Is it possible that I can have multiple html:submit buttons each pointing to a different action. that way also I can solve my problem. Else there should be some way to populate the Form even when a form.submit was not done. Please help. regards, Abhishek. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] :-) As sceptical as one can be! (-: -- Get a free, personalised email address at http://another.com TXT ALRT! Stop wasting money now. Send FREE, personalised txt msgs to UK mobile phones from http://another.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Problem with html:errors tag
Hi, Are you getting any errors/stack traces from your web container? Jon. -Original Message- From: BinhMinh Nguyen [mailto:[EMAIL PROTECTED]] Sent: 30 November 2001 00:36 To: Struts Users Mailing List Subject: Problem with html:errors tag For some reasons, this html:errors is no longer working for me :( can some one help me out? In the web.xml, I added this !--the application resources -- init-param param-nameapplication/param-name param-valueApplicationResources/param-value /init-param In the struts-config.xml, I added this: action-mappings !-- Retailer-Main -- action path=/forgetpassword type=com.fnet.struts.login.ForgetPasswordAction name=forgetPasswordForm input=/login.jsp scope=request validate=true /action /action-mappings in the ACtionForm bean my validate method work fine: public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { FNPrinter.toScreen(ForgetPasswordForm-validate(): validating User-info ...); ActionErrors errors = new ActionErrors(); if ((userId == null) || (userId.length() 1)) { FNPrinter.toScreen(ForgetPasswordForm-invalid UserId: + userId); errors.add(errInvalidUserId, new ActionError(error.login.forgetpw.userid.invalid)); } if ((userEmail == null) || (userEmail.length() 1)) { FNPrinter.toScreen(ForgetPasswordForm-invalid UserEmail: + userEmail); errors.add(errInvalidUserEmail, new ActionError(error.login.forgetpw.useremail.invalid)); } FNPrinter.toScreen(Error-Log: + errors.size()); return errors; } and the jsp page , I tried to display the error like this: tr td colspan=1nbsp;/td td align=leftUser_Name:nbsp;nbsp;/td td align=left colspan=1 html:text property=userId size=20 / nbsp;nbsp; html:errors property=errInvalidUserId / /td /tr my Application resources also has the property for this key... it still does not work for me, CAn someone help me on this. thanks Binh __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Logout Action
Hi Cameron! I had exactly the same problem. Do you use Netscape or Mozilla? Tomcat JDBC Realm? Well it worked with Konqueror and IE, but not with Netscape and Mozilla. What I found out was that you have to change the default preferences settings of the cache attributes within the browsers. Change them to the upper radio button (I think it was every session). Sinc then all things work fine. Regards Thomas -Original Message- From : Cameron Ingram [EMAIL PROTECTED] To : [EMAIL PROTECTED] Date : 29 November 2001 16:16:59 Subject : Logout Action Hi all and thanks in advance! I have a link that I map to a logout.do action. In this action it basically cleans up the resources and so forth. It clears the objects that I loaded in to the session. It then invalidates the session and then sends the user to a new page. So here is the problem. The first time the user goes through the application every thing works as it should. Then if the user goes back to the login page(with out closing the browser) and goes through the app again. Then clicks on the logout link the user is forwarded to the logout page but the log out action does not seemed to be called. I checked the session objects in login section and they are definitely present when they shouldn't be. By the way this does not happen if the user kills the browser and then re-opens. Any ideas on what could be causing this??? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] :-) As sceptical as one can be! (-: -- Personalise your email address at http://another.com THINK: your slogan or email address on a gorgeous mousemat CLICK HERE http://another-shop.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: session id is same for different Browser
You will see the same session ID for two browser windows if you 'clone' the browser window with CTRL+N (in IE). To get a separate session ID you need to start two instances of the browser, not clone the existing window. Rob Breeds bendiolas@nets cape.net To: [EMAIL PROTECTED] (Struts Users Mailing List) (Steve cc: Bendiola)Subject: RE: session id is same for different Browser 29/11/2001 20:55 Please respond to Struts Users Mailing List Gang, If you are using the same browser (opening 2 versions of IE, Netscape...), they could be sharing cookies, and thus the same session. Gao, Gang [EMAIL PROTECTED] wrote: Hi, I have a very strange case, When I logon to my site using two different Browser, I print out the session id and find it is same. Actully I open two different Browsers on same machine. How does it have same session id. Please help me out. I use struts and weblogic6.0 as web server. I put some value object in session, it looks like the second logon overwrite the first value object in session. Thanks a lot. Gang -- __ Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/ Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: session id is same for different Browser
I have solved this in a former project by writing or own session (bound to httpSession) and by assigning a unique value to each browser window (in a hidden field) if no value is found in the request, it means we have opened a new window, so a new unique id should be created regards, DC -Original Message- From: Rob Breeds [mailto:[EMAIL PROTECTED]] Sent: vrijdag 30 november 2001 10:39 To: Struts Users Mailing List Subject: RE: session id is same for different Browser You will see the same session ID for two browser windows if you 'clone' the browser window with CTRL+N (in IE). To get a separate session ID you need to start two instances of the browser, not clone the existing window. Rob Breeds bendiolas@nets cape.net To: [EMAIL PROTECTED] (Struts Users Mailing List) (Steve cc: Bendiola)Subject: RE: session id is same for different Browser 29/11/2001 20:55 Please respond to Struts Users Mailing List Gang, If you are using the same browser (opening 2 versions of IE, Netscape...), they could be sharing cookies, and thus the same session. Gao, Gang [EMAIL PROTECTED] wrote: Hi, I have a very strange case, When I logon to my site using two different Browser, I print out the session id and find it is same. Actully I open two different Browsers on same machine. How does it have same session id. Please help me out. I use struts and weblogic6.0 as web server. I put some value object in session, it looks like the second logon overwrite the first value object in session. Thanks a lot. Gang -- __ Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/ Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Is there anyway I can see which struts beans are loaded in Tomcat
Hi I want to know what struts beans are loaded in Tomcat. Is there any admin utility I can do this with? Cheers Tony -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
FW: Dynamically Developing HTML forms
Hi all , I am repeating my question as to is there I can create a web app using struts if I have to dynamically generate HTML forms as separate HTML pages from the application of WAR type. thanx -Original Message- From: Rajeev Singh [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 28, 2001 6:14 PM To: 'struts-user' Subject: Dynamically Developing HTML forms Hi, I have a query as to whether I can use Struts comfortably for an application wherein I have to generate HTML /JSP pages Dynamically. All these JSP's will have different names that too generated dynamically and not predecided names. I don't think we can WAR in this case so we cant follow Model 2 MVC and we have to go for Model 1. Thanx, Rajeev -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Dynamically Developing HTML forms
Hi Rajeev No answers as I don't understand the question. I am really curious a to what you mean by a dynamically generated application as most of struts is aimed at dynamic content. Do you mean using introspection/reflection to build an app on the fly? -Original Message- From: Rajeev Singh To: 'struts-user' Sent: 11/30/01 10:12 AM Subject: FW: Dynamically Developing HTML forms Hi all , I am repeating my question as to is there I can create a web app using struts if I have to dynamically generate HTML forms as separate HTML pages from the application of WAR type. thanx -Original Message- From: Rajeev Singh [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 28, 2001 6:14 PM To: 'struts-user' Subject: Dynamically Developing HTML forms Hi, I have a query as to whether I can use Struts comfortably for an application wherein I have to generate HTML /JSP pages Dynamically. All these JSP's will have different names that too generated dynamically and not predecided names. I don't think we can WAR in this case so we cant follow Model 2 MVC and we have to go for Model 1. Thanx, Rajeev -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Cannot create rewrite URL: java.net.MalformedURL.Cannot retrive ActionForward
Hi I have a logoff action which I am having problems calling. I have it defined in my struts-config.xml file as ---struts-config.xml start-- [snip] actionpath=/logoff type=com.testdomainnamefoo.LogoffAction forward name=success path=/index.jsp/ /action [snip] ---struts-config.xml stop-- It seems to be registered correctly since the tomcat log shows ---catalina.out start-- [snip] Set org.apache.struts.action.ActionForward properties Call org.apache.struts.action.ActionMapping.addForward(ActionForward[success]) Pop org.apache.struts.action.ActionForward Call org.apache.struts.action.ActionServlet.addMapping(ActionMapping[path=/logoff, type=com.testdomainnamefoo.LogoffAction]) Pop org.apache.struts.action.ActionMapping [snip] ---catalina.out stop-- I then call this in a jsp page -main.jsp start- [snip] html:link forward=/logoffbean:message key=top.logoff//html:link [snip] -main.jsp stop- But when I access this page I always get the error -log_lo start- [snip] javax.servlet.ServletException: Cannot create rewrite URL: java.net.MalformedURL Exception: Cannot retrive ActionForward named /logoff at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageCon textImpl.java) at org.apache.jsp.top$jsp._jspService(top$jsp.java:807) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspSer vlet.java) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java [snip] -main.jsp start- I cannot see where I am going wrong. Can anyone see what I am doing wrong? Cheers Tony -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Dynamically Developing HTML forms
Hi Tom, By Dynamic generation I mean generation of WEB pages on Fly. If we generate web pages on fly I don't know how it can be included in the WAR. In my webapp I am having a fixed set of JSP's plus while application is running the users will create additional pages which are reports or new forms matching to their transactions/profiles. Its here that I am not getting how can I use Struts. Thanx, Rajeev -Original Message- From: Tom Lister [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 3:45 PM To: 'Rajeev Singh '; ''struts-user' ' Subject: RE: Dynamically Developing HTML forms Hi Rajeev No answers as I don't understand the question. I am really curious a to what you mean by a dynamically generated application as most of struts is aimed at dynamic content. Do you mean using introspection/reflection to build an app on the fly? -Original Message- From: Rajeev Singh To: 'struts-user' Sent: 11/30/01 10:12 AM Subject: FW: Dynamically Developing HTML forms Hi all , I am repeating my question as to is there I can create a web app using struts if I have to dynamically generate HTML forms as separate HTML pages from the application of WAR type. thanx -Original Message- From: Rajeev Singh [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 28, 2001 6:14 PM To: 'struts-user' Subject: Dynamically Developing HTML forms Hi, I have a query as to whether I can use Struts comfortably for an application wherein I have to generate HTML /JSP pages Dynamically. All these JSP's will have different names that too generated dynamically and not predecided names. I don't think we can WAR in this case so we cant follow Model 2 MVC and we have to go for Model 1. Thanx, Rajeev -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DB connection pool throws exception
I configured MySql datasource but it doesnt work if I run WEBApp with Tomcat that's embedded in Forte CE 3.0. Have you ever seen the exception I've got ? Maris Don't forget to configure your database int the struts-config.xml Ciao struts-config data-sources data-source autoCommit=true description=MySQL Data Source Configuration driverClass=org.gjt.mm.mysql.Driver maxCount=10 minCount=2 password=wqqqw url=jdbc:mysql://varan/addressbook?autoReconnect=true user=poweruser / /data-sources ... Error: 500 Location: /logon.jsp Internal Servlet Error: javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex tImpl.java:459) at _0002flogon_0002ejsplogon_jsp_0._jspService(_0002flogon_0002ejsplogon_js p_0.java:450) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle t.java:177) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391) at org.netbeans.modules.web.tomcat.JspServlet.service(JspServlet.java:91) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.jav a:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(H ttpConnectionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416 ) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:49 8) at java.lang.Thread.run(Thread.java:484) Root cause: javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:773) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:481) at _0002flogon_0002ejsplogon_jsp_0._jspService(_0002flogon_0002ejsplogon_js p_0.java:137) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle t.java:177) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391) at org.netbeans.modules.web.tomcat.JspServlet.service(JspServlet.java:91) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.jav a:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(H ttpConnectionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416 ) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:49 8) at java.lang.Thread.run(Thread.java:484) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
problems getting struts example to run
I have done my homework. I just cannot get the Struts example to run in VAJ4.0 using WTE (not WAS). Please can someone help me. the following are the symptoms. I type in the url http:/localhost:8080/strutsexample/index.jsp I then get to the main page. When I click on the logon url, the following error msg appears. (-*) now I managed to trace this down to the doEndTag() method in org.apache.struts.taglib.FormTag class. When it executes the line pageContext.removeAttribute(Constants.BEAN_KEY); IT CHUCKS THE EXCEPTION. Thanking you in advance for your help with this. *cos i don't have a clue. regards Darryl -* Error 500 An error has occured while processing request:http://localhost:8080/strutsexample/logon.jsp Message: Server caught unhandled exception from servlet [jsp]: cant remove Attributes from request scope Target Servlet: jsp StackTrace: Root Error-1: cant remove Attributes from request scope java.lang.IllegalArgumentException: cant remove Attributes from request scope java.lang.Throwable(java.lang.String) java.lang.Exception(java.lang.String) java.lang.RuntimeException(java.lang.String) java.lang.IllegalArgumentException(java.lang.String) void org.apache.jasper.runtime.PageContextImpl.removeAttribute(java.lang.String, int) int org.apache.struts.taglib.html.FormTag.doEndTag() void _logon_xjsp._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpServlet Request, javax.servlet.http.HttpServletResponse) void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(javax.servlet .http.HttpServletRequest, javax.servlet.http.HttpServletResponse, boolean) void org.apache.jasper.runtime.JspServlet.serviceJspFile(javax.servlet.http.HttpS ervletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) void org.apache.jasper.runtime.JspServlet.service(javax.servlet.http.HttpServletR equest, javax.servlet.http.HttpServletResponse) void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void com.ibm.servlet.engine.webapp.StrictServletInstance.doService(javax.servlet. ServletRequest, javax.servlet.ServletResponse) void com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(javax.servlet. ServletRequest, javax.servlet.ServletResponse) void com.ibm.servlet.engine.webapp.IdleServletState.service(com.ibm.servlet.engin e.webapp.StrictLifecycleServlet, javax.servlet.ServletRequest, javax.servlet.ServletResponse) void com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(javax.servlet.S ervletRequest, javax.servlet.ServletResponse) void com.ibm.servlet.engine.webapp.ServletInstance.service(javax.servlet.ServletR equest, javax.servlet.ServletResponse, com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent) void com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(com.ibm.se rvlet.engine.webapp.ServletInstanceReference, javax.servlet.ServletRequest, javax.servlet.ServletResponse, com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent) void com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(javax.servle t.ServletRequest, javax.servlet.ServletResponse, com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent) void com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(c om.ibm.servlet.engine.webapp.WebAppRequest, javax.servlet.http.HttpServletResponse, boolean) void com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(javax.servlet .ServletRequest, javax.servlet.ServletResponse, boolean) void com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(javax.servlet. ServletRequest, javax.servlet.ServletResponse) void com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(java.lang.Obje ct) void com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(java.lan g.Object) void com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(java.lang.S tring, com.ibm.servlet.engine.srp.ISRPConnection) void com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(com.ibm.ser vlet.engine.oselistener.api.IOSEConnection) void com.ibm.servlet.engine.http_transport.HttpTransportHandler.handleConnection( java.net.Socket) void com.ibm.servlet.engine.http_transport.HttpTransportHandler.run() void java.lang.Thread.run() -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
dbtags ResultSet tag problem
Hi, This code iterates ResultSet inserted into session and adds it's elements to JavaScript table: sql:resultSet id="rs" name="rset" scope="session" comTresc[licznik++] = "sql:getColumn colName="comment"/"; /sql:resultSet And it works. As You can see ResultSet is inserted into session with the key "rset". But I want to use this result set again in this page. If I tried to do that I got a NullPointerException on doStartTag. So I figured, that maybe I have to rewind this RS to the beggining (it's a ResultSet.TYPE_SCROLL_INSENSITIVE ResultSet type). So what I do is: % ((ResultSet)session.getAttribute("rset")).beforeFirst();% And again I get a null pointer exception but this time it's exactly in this point of generated servlet where the above code fragment is executed (beforeFirst). It looks like this: Root cause: java.lang.NullPointerException at org.postgresql.jdbc2.ResultSet.beforeFirst(ResultSet.java:762) at _0002fkomentarze_0002ejspkomentarze_jsp_0._jspService(_0002fcomments_0002ejspcomments_jsp_0.java:181) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) ... My question is, is it possible to use same ResultSet twice on one page? Does this RS tag remove RS object from session? -- Best regards, Maciej -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Hidden Field in a form. Do I use struts taglib or vanilla html?
I believe Ted actually means 'reset()' instead of 'init()'. - Original Message - From: Ted Husted [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, November 29, 2001 11:15 AM Subject: Re: Hidden Field in a form. Do I use struts taglib or vanilla html? In Struts 1.0.1, init() is called if the ActionForm is instantiated by the JavaServer Page. In Struts 1.0, this only happens when the ActionForm is instantiated by the ActionServlet. Of course, any default values assigned to the fields in the ActionForm class itself will be available in either case. The recommended control flow is to go through an Action first, and populate the ActionForm there. Populating the ActionForm from the JSP is a Model 1 strategy. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel +1 716 737-3463 -- http://www.husted.com/struts/ David Lauta wrote: Is there a method in the framework that gets invoked allowing you to initialize the ActionForm before the JSP is displayed? Brett Porter wrote: That's an interesting design decision. I have always had a form bean and then another bean containing the actual data. The action copies it across, processes it, and stores it. The reason I'd do it that way is that I imagine the message is a business class, and you don't really want you model polluted by extending an ActionForm. Maybe I've been living in OOAD land too long though ;) This can trip you up though - at least once I have added the form element, added it to the bean, added it to the form bean, and forgetten to do the setter in the action :) The way around that is probably a function in the form bean that says fill my business class and fill from a business class. Actually, I might put that in my todo list :D Cheers, Brett -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, 29 November 2001 12:48 PM To: Struts Users Mailing List Subject: Re: Hidden Field in a form. Do I use struts taglib or vanilla ht ml? The data I am storing in the bean is logically different from what the hidden field value is, I have a message message { string Recipent string From string MessageBode } And the hidden field is action=sendMessage and I didn't think that message { string Action string Recipent string From string MessageBode } would be the correct thing to do, but I am open to suggestions. If it works out easier to put this extra field in my message formbean then I will do it. What do you think? Cheers Tony Brett Porter wrote: The question I ask is why you wouldn't put it in your form bean? I prefer form.getAction() over httpServletRequest.getParameter( action ) any day! :) -Original Message- From: Yee Keat [mailto:[EMAIL PROTECTED]] Sent: Thursday, 29 November 2001 12:36 PM To: Struts Users Mailing List Subject: Re: Hidden Field in a form. Do I use struts taglib or vanilla html? Yup, using the taglib makes it compulsory to have that field in your FormBean On Thursday 29 November 2001 09:25 am, you wrote: Hi I want to include a hidden field in a form which I have. I do not want this information to be included in the formbean which is defined for this page. How can I do this? Should I just use plain html INPUT TYPE=hidden NAME=action VALUE=send without using the html taglib supplied with struts? Cheers Tony -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Thank you, David Lauta [EMAIL PROTECTED] (561)272-2698 (561)289-0502 cell -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
struts-config not found in Websphere 3.5.2 FixPack3
I'm configuring the Struts Action servlet on WebSphere 3.5.2 with fix pack 3, but I get an exception on startup (because this server uses loadonstartup). The servlet cant find the /WEB-INF/struts-config.xml file, I have the following file: /opt/IBMWebAS/hosts/default_host/myapp/web/WEB-INF/struts-config.xml file, And the documen root of my web application is: /opt/IBMWebAS/hosts/default_host/myapp/web/ It is ok? Where shold be placed struts-config.xml? IMHO this config is right.. but not working. Any suggestion or tip will be really appreciated. This is a fragment of default_servlet_stdout.log ---cut--- [01.11.30 10:04:39:385 GMT-02:00] e82f28da ServletInstan A SRVE0048I: Loading servlet: action [01.11.30 10:04:39:885 GMT-02:00] e82f28da WebGroup A SRVE0091I: [Servlet LOG]: action: init [01.11.30 10:04:39:987 GMT-02:00] e82f28da WebGroup A SRVE0091I: [Servlet LOG]: action: Loading application resources from res ource Cuida2Resources [01.11.30 10:04:39:990 GMT-02:00] e82f28da WebGroup A SRVE0091I: [Servlet LOG]: action: Initializing configuration from resour ce path /WEB-INF/struts-config.xml [01.11.30 10:04:40:005 GMT-02:00] e82f28da ServletInstan X Uncaught init() exception thrown by servlet {0}: {1} action javax.servlet.UnavailableException: Missing configuration resource for path /WEB-INF/struts-config. xml at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1316) ---cut--- -- Juan Pablo Villaverde Tec. en Infraestructura de Redes Soluciones Punto Com S.A. http://www.spcom.com.ar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: problems getting struts example to run
Hi, Change the two lines of code in FormTag.doEndTag that remove attributes from the request to read: pageContext.getRequest().removeAttribute(Constants.BEAN_KEY); pageContext.getRequest().removeAttribute(Constants.FORM_KEY); Jon Ridgway www.upco.co.uk -Original Message- From: Darryl Nortje [mailto:[EMAIL PROTECTED]] Sent: 30 November 2001 11:36 To: 'Struts Users Mailing List' Subject: problems getting struts example to run I have done my homework. I just cannot get the Struts example to run in VAJ4.0 using WTE (not WAS). Please can someone help me. the following are the symptoms. I type in the url http:/localhost:8080/strutsexample/index.jsp I then get to the main page. When I click on the logon url, the following error msg appears. (-*) now I managed to trace this down to the doEndTag() method in org.apache.struts.taglib.FormTag class. When it executes the line pageContext.removeAttribute(Constants.BEAN_KEY); IT CHUCKS THE EXCEPTION. Thanking you in advance for your help with this. *cos i don't have a clue. regards Darryl -* Error 500 An error has occured while processing request:http://localhost:8080/strutsexample/logon.jsp Message: Server caught unhandled exception from servlet [jsp]: cant remove Attributes from request scope Target Servlet: jsp StackTrace: Root Error-1: cant remove Attributes from request scope java.lang.IllegalArgumentException: cant remove Attributes from request scope java.lang.Throwable(java.lang.String) java.lang.Exception(java.lang.String) java.lang.RuntimeException(java.lang.String) java.lang.IllegalArgumentException(java.lang.String) void org.apache.jasper.runtime.PageContextImpl.removeAttribute(java.lang.String, int) int org.apache.struts.taglib.html.FormTag.doEndTag() void _logon_xjsp._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) void org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpServlet Request, javax.servlet.http.HttpServletResponse) void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(javax.servlet .http.HttpServletRequest, javax.servlet.http.HttpServletResponse, boolean) void org.apache.jasper.runtime.JspServlet.serviceJspFile(javax.servlet.http.HttpS ervletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) void org.apache.jasper.runtime.JspServlet.service(javax.servlet.http.HttpServletR equest, javax.servlet.http.HttpServletResponse) void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) void com.ibm.servlet.engine.webapp.StrictServletInstance.doService(javax.servlet. ServletRequest, javax.servlet.ServletResponse) void com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(javax.servlet. ServletRequest, javax.servlet.ServletResponse) void com.ibm.servlet.engine.webapp.IdleServletState.service(com.ibm.servlet.engin e.webapp.StrictLifecycleServlet, javax.servlet.ServletRequest, javax.servlet.ServletResponse) void com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(javax.servlet.S ervletRequest, javax.servlet.ServletResponse) void com.ibm.servlet.engine.webapp.ServletInstance.service(javax.servlet.ServletR equest, javax.servlet.ServletResponse, com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent) void com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(com.ibm.se rvlet.engine.webapp.ServletInstanceReference, javax.servlet.ServletRequest, javax.servlet.ServletResponse, com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent) void com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(javax.servle t.ServletRequest, javax.servlet.ServletResponse, com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent) void com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(c om.ibm.servlet.engine.webapp.WebAppRequest, javax.servlet.http.HttpServletResponse, boolean) void com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(javax.servlet .ServletRequest, javax.servlet.ServletResponse, boolean) void com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(javax.servlet. ServletRequest, javax.servlet.ServletResponse) void com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(java.lang.Obje ct) void com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(java.lan g.Object) void com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(java.lang.S tring, com.ibm.servlet.engine.srp.ISRPConnection) void
RE: struts-config not found in Websphere 3.5.2 FixPack3
Hi, Have you added the ActionServlet mapping into your webapp name.webapp file? This mapping tells the action servlet where to find struts-config.xml. If you have the mapping what entry do you have for the config parameter? Jon Ridgway www.upco.co.uk -Original Message- From: jpablo [mailto:[EMAIL PROTECTED]] Sent: 30 November 2001 12:30 To: Struts Users Mailing List Subject: struts-config not found in Websphere 3.5.2 FixPack3 I'm configuring the Struts Action servlet on WebSphere 3.5.2 with fix pack 3, but I get an exception on startup (because this server uses loadonstartup). The servlet cant find the /WEB-INF/struts-config.xml file, I have the following file: /opt/IBMWebAS/hosts/default_host/myapp/web/WEB-INF/struts-config.xml file, And the documen root of my web application is: /opt/IBMWebAS/hosts/default_host/myapp/web/ It is ok? Where shold be placed struts-config.xml? IMHO this config is right.. but not working. Any suggestion or tip will be really appreciated. This is a fragment of default_servlet_stdout.log ---cut--- [01.11.30 10:04:39:385 GMT-02:00] e82f28da ServletInstan A SRVE0048I: Loading servlet: action [01.11.30 10:04:39:885 GMT-02:00] e82f28da WebGroup A SRVE0091I: [Servlet LOG]: action: init [01.11.30 10:04:39:987 GMT-02:00] e82f28da WebGroup A SRVE0091I: [Servlet LOG]: action: Loading application resources from res ource Cuida2Resources [01.11.30 10:04:39:990 GMT-02:00] e82f28da WebGroup A SRVE0091I: [Servlet LOG]: action: Initializing configuration from resour ce path /WEB-INF/struts-config.xml [01.11.30 10:04:40:005 GMT-02:00] e82f28da ServletInstan X Uncaught init() exception thrown by servlet {0}: {1} action javax.servlet.UnavailableException: Missing configuration resource for path /WEB-INF/struts-config. xml at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1316) ---cut--- -- Juan Pablo Villaverde Tec. en Infraestructura de Redes Soluciones Punto Com S.A. http://www.spcom.com.ar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: File Upload Problem.
Hi Marli, No, you should be able to use the struts utils in your servlet. You will have to manually create a FormFile however. Look at the source for the html:file tag. Jon. -Original Message- From: Marli Satyadi [mailto:[EMAIL PROTECTED]] Sent: 30 November 2001 00:13 To: Struts Users Mailing List; 'Struts Users Mailing List' Subject: RE: File Upload Problem. Hi Jon, I am trying to do file upload programatically, not using the browser and I want to use the struts file upload library to achieve this. So I want to try the library first by writing a simple html file and a simple servlet for testing. Does this mean that I cannot use the upload code if I don't use struts tags ?? Thanks. Marli. At 09:42 AM 11/29/2001 +, Jon.Ridgway wrote: Hi Marli, I might be missing something here, but you don't appear to be using struts. Are you aware that there is a strurs tag for file upload? Have a look at the struts examples. Jon. -Original Message- From: Marli Satyadi [mailto:[EMAIL PROTECTED]] Sent: 29 November 2001 01:23 To: [EMAIL PROTECTED] Subject: File Upload Problem. Hello, I was writing some upload code to test the use of MultipartIterator class. My html code is as follows: - BODY BGCOLOR=FF h1 MULTIPART TEST/h1 FORM NAME=loadfile ACTION=/MDC/servlet/servlet/com.cisco.nm.callhome.servlet.TestServlet ENCTYPE='multipart/form-data' METHOD=POST CLASS: INPUT NAME=class TYPE=text VALUE=File br COMMAND: INPUT NAME=cmd TYPE=text VALUE=Add br DATA (XML): textarea name=dataParam rows=20 cols=80/textarea br File Location: INPUT TYPE=file NAME=uploadfile SIZE=50 br INPUT TYPE=SUBMIT NAME=SUBMIT /FORM /BODY /HTML My servlet code is as follows: --- protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException { LogUtil.debug(_Class, - DO POST); MultipartIterator iter = new MultipartIterator(req, 64*1024, Integer.MAX_VALUE, C:/Temp); MultipartElement elem = null; while( (elem = iter.getNextElement()) != null ) { if( elem.isFile() ) { System.out.println(ELEM is a file); System.out.println(FILENAME = + elem.getFileName()); System.out.println(FILE PATH = + elem.getFile().getAbsolutePath()); } else { System.out.print(NAME = ' + elem.getName() + '); System.out.println(. VALUE = ' + elem.getValue() + '); //System.out.println(elem.getName() + = + elem.getValue()); } } } When I use my browser to the html file, put some data in the dataParam text area and hit Submit, I got the following result in Tomcat stdout.log NAME = 'class'. VALUE = 'File' NAME = 'cmd'. VALUE = 'Add' /File'/AuthTupleswordbejo/Password1663eb7d56063ec67f23be/Checksum ELEM is a file FILENAME = ch-p506-2_enable_callhome.cfg FILE PATH = C:\Temp\strts4674.tmp NAME = 'SUBMIT'. VALUE = 'Submit Query' My question is: -- * Is there an explanation on why the dataParam parameter is not printed out, or printed out but has the wrong value ? * I also have written a Java multipart writer to test it, but it looks like that the file is always larger by 2 bytes. Isn't the format for multipart request like this: --Boundary\r\n content-disposition: form-data; name=blah; filename=file.txt\r\n Content-type: application/octet-stream\r\n \r\n Body goes here.. --Boundary--\r\n Am I correct about the CRLF (\r\n) ? I have read RFC 1867 and RFC 2046 and it looks correct. Any ideas ? Thanks in advance. Marli. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[REPOST FROM DEV] General Model Question...
Hi, It was correctly pointed out to me that I had posted this to the wrong list (sorry about that folks!). So, I am posting this here in the hopes that some of you can help me: I have a couple of basic questions (I have only started using STRUTS, so if this is obvious please slap some links at me and send me on my way :-) ): Which object type are people having their Action's send into their business and/or data layers: ones that derive from ActionForm or ones that implement the Value Object pattern? And how are they converting the business and/or data layer's response back (into Action Forms? or are you sending back the Value Object so that the custom tags can use that?). My initial feeling on this was to only send Value Objects to the business and data layers so that they would not get coupled to what is obviously a presentation layer object (I saw Actions as bridges between the layers, converting between the Action Forms and Value Objects and back again). The problem I hit was that I did not want to have to write a bunch of conversion code (see below) to create my Value Object (since it is immutable and, hence does not have the setValue(object) methods that automatic JavaBean conversion utilities need): MyValueObject val = new MyValueObject(converter.convert(form.getValue(), typeOfConversion)); Where the above code would take the String value from an ActionForm, convert it into the type needed, and pass it into the constructor for the Value Object. Hit the same problem running back the other way (from Value Objects to Action Forms). OR are people making their value objects mutable and maybe having them implement a read-only interface that the business and data layers use when interacting with or returning the object? OR are people passing in the ActionForm to the Value Object so that it can extract what it needs (are you fronting it with an interface?)? OR are people passing in a map of properties and their values to the Value Object for it to pick and choose what it wants? OR something else entirely...? When you are going back from Value Object to Action Form, how are you controlling the output format? I know that the Action needs to understand the format of the data that it would expect to receive from a submitted form... So, I am assuming that all formatting has to happen before it gets to the custom tag (the only exception being when it is writing data that will not come back through a form or query string). Is this what people are doing? Thanks! Allen -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [REPOST FROM DEV] General Model Question...
Check the earlier discussion Design question - Action Form vs Business Delegates/Value Objects, started by this post http://www.mail-archive.com/struts-user@jakarta.apache.org/msg18315.html. If you try now, you should see all posts down this page: http://www.mail-archive.com/struts-user@jakarta.apache.org/thrd2.html. Fr. -Original Message- From: Allen M. Servedio [mailto:[EMAIL PROTECTED]] Sent: 30 November 2001 14:01 To: [EMAIL PROTECTED] Subject: [REPOST FROM DEV] General Model Question... Hi, It was correctly pointed out to me that I had posted this to the wrong list (sorry about that folks!). So, I am posting this here in the hopes that some of you can help me: I have a couple of basic questions (I have only started using STRUTS, so if this is obvious please slap some links at me and send me on my way :-) ): Which object type are people having their Action's send into their business and/or data layers: ones that derive from ActionForm or ones that implement the Value Object pattern? And how are they converting the business and/or data layer's response back (into Action Forms? or are you sending back the Value Object so that the custom tags can use that?). My initial feeling on this was to only send Value Objects to the business and data layers so that they would not get coupled to what is obviously a presentation layer object (I saw Actions as bridges between the layers, converting between the Action Forms and Value Objects and back again). The problem I hit was that I did not want to have to write a bunch of conversion code (see below) to create my Value Object (since it is immutable and, hence does not have the setValue(object) methods that automatic JavaBean conversion utilities need): MyValueObject val = new MyValueObject(converter.convert(form.getValue(), typeOfConversion)); Where the above code would take the String value from an ActionForm, convert it into the type needed, and pass it into the constructor for the Value Object. Hit the same problem running back the other way (from Value Objects to Action Forms). OR are people making their value objects mutable and maybe having them implement a read-only interface that the business and data layers use when interacting with or returning the object? OR are people passing in the ActionForm to the Value Object so that it can extract what it needs (are you fronting it with an interface?)? OR are people passing in a map of properties and their values to the Value Object for it to pick and choose what it wants? OR something else entirely...? When you are going back from Value Object to Action Form, how are you controlling the output format? I know that the Action needs to understand the format of the data that it would expect to receive from a submitted form... So, I am assuming that all formatting has to happen before it gets to the custom tag (the only exception being when it is writing data that will not come back through a form or query string). Is this what people are doing? Thanks! Allen -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] The information in this email is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorised. If you are not an intended recipient, please notify the sender of this email immediately. You should not copy, use or disseminate the information contained in the email. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Capco. http://www.capco.com *** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [REPOST FROM DEV] General Model Question...
Hi Allen, Have a look at: http://www.mail-archive.com/struts-user@jakarta.apache.org/ Ted Husted posted a response to similar question(s) yesterday. Jon. -Original Message- From: Allen M. Servedio [mailto:[EMAIL PROTECTED]] Sent: 30 November 2001 13:01 To: [EMAIL PROTECTED] Subject: [REPOST FROM DEV] General Model Question... Hi, It was correctly pointed out to me that I had posted this to the wrong list (sorry about that folks!). So, I am posting this here in the hopes that some of you can help me: I have a couple of basic questions (I have only started using STRUTS, so if this is obvious please slap some links at me and send me on my way :-) ): Which object type are people having their Action's send into their business and/or data layers: ones that derive from ActionForm or ones that implement the Value Object pattern? And how are they converting the business and/or data layer's response back (into Action Forms? or are you sending back the Value Object so that the custom tags can use that?). My initial feeling on this was to only send Value Objects to the business and data layers so that they would not get coupled to what is obviously a presentation layer object (I saw Actions as bridges between the layers, converting between the Action Forms and Value Objects and back again). The problem I hit was that I did not want to have to write a bunch of conversion code (see below) to create my Value Object (since it is immutable and, hence does not have the setValue(object) methods that automatic JavaBean conversion utilities need): MyValueObject val = new MyValueObject(converter.convert(form.getValue(), typeOfConversion)); Where the above code would take the String value from an ActionForm, convert it into the type needed, and pass it into the constructor for the Value Object. Hit the same problem running back the other way (from Value Objects to Action Forms). OR are people making their value objects mutable and maybe having them implement a read-only interface that the business and data layers use when interacting with or returning the object? OR are people passing in the ActionForm to the Value Object so that it can extract what it needs (are you fronting it with an interface?)? OR are people passing in a map of properties and their values to the Value Object for it to pick and choose what it wants? OR something else entirely...? When you are going back from Value Object to Action Form, how are you controlling the output format? I know that the Action needs to understand the format of the data that it would expect to receive from a submitted form... So, I am assuming that all formatting has to happen before it gets to the custom tag (the only exception being when it is writing data that will not come back through a form or query string). Is this what people are doing? Thanks! Allen -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: browser platform compatibility
i'm using the html taglib privided with struts and have tried the resulting pages on windows (IE 5.5) and linux (opera, mozilla and konqueror) - whilst this is hardly exhaustive testing (i need to try netscape and older versions of IE) i've yet to find any problems. Hope that helps On Thursday 29 Nov 2001 8:32 pm, you wrote: Hi, I was wonder if the HTML generated by the Struts tag libraries are compatible in IE Netscape as well as on Windows, AIX, solaris HP systems? I don't seem to recall any documentation on this subject. Have anyone integrated and tested their applications on these platforms? Thanks, Elena -- Martin Samm [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Logout Action
Hi Cameron! I had exactly the same problem. Do you use Netscape or Mozilla? Tomcat JDBC Realm? Well it worked with Konqueror and IE, but not with Netscape and Mozilla. What I found out was that you have to change the default preferences settings of the cache attributes within the browsers. Change them to the upper radio button (I think it was every session). Then all things work fine. Regards Thomas -Original Message- From : Cameron Ingram [EMAIL PROTECTED] To : [EMAIL PROTECTED] Date : 29 November 2001 16:16:59 Subject : Logout Action Hi all and thanks in advance! I have a link that I map to a logout.do action. In this action it basically cleans up the resources and so forth. It clears the objects that I loaded in to the session. It then invalidates the session and then sends the user to a new page. So here is the problem. The first time the user goes through the application every thing works as it should. Then if the user goes back to the login page(with out closing the browser) and goes through the app again. Then clicks on the logout link the user is forwarded to the logout page but the log out action does not seemed to be called. I checked the session objects in login section and they are definitely present when they shouldn't be. By the way this does not happen if the user kills the browser and then re-opens. Any ideas on what could be causing this??? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] :-) As sceptical as one can be! (-: -- Get a free, personalised email address at http://another.com TXT ALRT! Stop wasting money now. Send FREE, personalised txt msgs to UK mobile phones from http://another.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
taglibs and jsp:include
this is not directly Struts but seemed the best qualified forum (it is for a struts based app however). I'm using a custom tag to decide which jsp to include (based on some request variables) - the tag then uses a JSP writer to create the jsp:include - trouble is the 'jsp:include tag is just written out and not 'interpretted', i.e. the page isn't included. How do i get the container to interpret the include? -- Martin Samm [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Does struts provide a function to escape special characters received from a form?
I imagine http://jakarta.apache.org/regexp/ might be interesting for you... hth, tomK -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: vrijdag 30 november 2001 2:08 To: Struts Users Mailing List Subject: Does struts provide a function to escape special characters received from a form? Hi Ladies and Gentlemen I want to insert data into a database. I have the database connection set up and in the case of data without special characters the insert works fine. However, the data is coming from a form on a html page and the user can insert special characters, in particualar characters like \ ' cause a problem when I try and insert into the database since they are not escaped when I construct the query which is put into the database. Does Struts provide function/s which can help with inserting text from a html form into a database. How do other people handle this situtation? Cheers Tony -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Dynamically Developing HTML forms
Hi, I have created a dynamic html form using struts. Bascially I have a user preference page and want to dynamically show text input fields based on preference names (i.e. favorite color, age, etc.) stored inside a database table. Since my page would have both dynamic and non dynamic input fields I integrated the page with struts. This is how I accomplished it: 1. Each dynamic created text field was given a name that had a prefix of up_ to indicate it was a dynamic generated user preference field. 2. Inside my Form and Action class when the user hit the submit button on the page I would loop through all the request parameters looking for paramters that started with up_. Any more questions, let me know. --- Rajeev Singh [EMAIL PROTECTED] wrote: Hi Tom, By Dynamic generation I mean generation of WEB pages on Fly. If we generate web pages on fly I don't know how it can be included in the WAR. In my webapp I am having a fixed set of JSP's plus while application is running the users will create additional pages which are reports or new forms matching to their transactions/profiles. Its here that I am not getting how can I use Struts. Thanx, Rajeev -Original Message- From: Tom Lister [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 3:45 PM To: 'Rajeev Singh '; ''struts-user' ' Subject: RE: Dynamically Developing HTML forms Hi Rajeev No answers as I don't understand the question. I am really curious a to what you mean by a dynamically generated application as most of struts is aimed at dynamic content. Do you mean using introspection/reflection to build an app on the fly? -Original Message- From: Rajeev Singh To: 'struts-user' Sent: 11/30/01 10:12 AM Subject: FW: Dynamically Developing HTML forms Hi all , I am repeating my question as to is there I can create a web app using struts if I have to dynamically generate HTML forms as separate HTML pages from the application of WAR type. thanx -Original Message- From: Rajeev Singh [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 28, 2001 6:14 PM To: 'struts-user' Subject: Dynamically Developing HTML forms Hi, I have a query as to whether I can use Struts comfortably for an application wherein I have to generate HTML /JSP pages Dynamically. All these JSP's will have different names that too generated dynamically and not predecided names. I don't think we can WAR in this case so we cant follow Model 2 MVC and we have to go for Model 1. Thanx, Rajeev -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] = ~~~ Scott __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Logout Action
Actually I am using IE tomcat-3.2 and apache 1.3 , I havent tried it with the others browsers. I am really quite confused as to why this is happening. [EMAIL PROTECTED] 11/30/01 04:28AM Hi Cameron! I had exactly the same problem. Do you use Netscape or Mozilla? Tomcat JDBC Realm? Well it worked with Konqueror and IE, but not with Netscape and Mozilla. What I found out was that you have to change the default preferences settings of the cache attributes within the browsers. Change them to the upper radio button (I think it was every session). Then all things work fine. Regards Thomas -Original Message- From : Cameron Ingram [EMAIL PROTECTED] To : [EMAIL PROTECTED] Date : 29 November 2001 16:16:59 Subject : Logout Action Hi all and thanks in advance! I have a link that I map to a logout.do action. In this action it basically cleans up the resources and so forth. It clears the objects that I loaded in to the session. It then invalidates the session and then sends the user to a new page. So here is the problem. The first time the user goes through the application every thing works as it should. Then if the user goes back to the login page(with out closing the browser) and goes through the app again. Then clicks on the logout link the user is forwarded to the logout page but the log out action does not seemed to be called. I checked the session objects in login section and they are definitely present when they shouldn't be. By the way this does not happen if the user kills the browser and then re-opens. Any ideas on what could be causing this??? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] :-) As sceptical as one can be! (-: -- Get a free, personalised email address at http://another.com TXT ALRT! Stop wasting money now. Send FREE, personalised txt msgs to UK mobile phones from http://another.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Does struts provide a function to escape special characters received from a form?
Hi Ladies and Gentlemen I want to insert data into a database. I have the database connection set up and in the case of data without special characters the insert works fine. However, the data is coming from a form on a html page and the user can insert special characters, in particualar characters like \ ' cause a problem when I try and insert into the database since they are not escaped when I construct the query which is put into the database. Does Struts provide function/s which can help with inserting text from a html form into a database. How do other people handle this situtation? Cheers Tony Hello Tony, to my knowledge struts-doesn't provide anything. However, the java-api does ! Using PreparedStatements, placeholders and 'set' functions automatically does the escaping for you. Your code then looks like this: PreparedStatement stmt = con.prepareStatement( INSERT INTO TABLE(FIELD) VALUES(?) ) ; stmt.setString(1, SomeUnquotedString ) ; stmt.executeUpdate() ; The nice thing about using this is that escaping is performed by the database-specific driver and therefore is always appropriate for your connection. Hope this helps, Mark Mark Schenk | Ceci n'est pas une signature Blackboard Project Manager | Delft University of Technology |E-mail: [EMAIL PROTECTED] Dept.: DTO |Phone: +31 152785448 (85448) Room: LB00.680 |Fax:+31 152786359 - -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: FW: Dynamically Developing HTML forms
The response is passed to the Action, and so you can use any technique you would use with a conventional servlet. Just return null to the ActionServlet when you are done. http://www.jguru.com/forums/view.jsp?EID=565863 I don't believe JSP pages can be generated dynamically. These are precompiled by another service (e.g. Jasper) in cooperation with the container. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel +1 716 737-3463 -- http://www.husted.com/struts/ Rajeev Singh wrote: Hi all , I am repeating my question as to is there I can create a web app using struts if I have to dynamically generate HTML forms as separate HTML pages from the application of WAR type. thanx -Original Message- From: Rajeev Singh [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 28, 2001 6:14 PM To: 'struts-user' Subject: Dynamically Developing HTML forms Hi, I have a query as to whether I can use Struts comfortably for an application wherein I have to generate HTML /JSP pages Dynamically. All these JSP's will have different names that too generated dynamically and not predecided names. I don't think we can WAR in this case so we cant follow Model 2 MVC and we have to go for Model 1. Thanx, Rajeev -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: browser platform compatibility
We've carefully followed the HTML 4.01 specification, to the annoyance of some developers who want to use undocumented features ;-) If there are any compatiblity issues, it would be because the browser is not compliant. But I've never seen an incompatibility reported. Only requests to support browser-specific features that are not part of the spec. The little HTML Struts generates is quite straight-forward. There is an issue with the way some version of Netscape on the Windows platform handled focus when set from a JavaScript. See http://www.jguru.com/faq/view.jsp?EID=471948 for a workaround for this Netscape bug. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel +1 716 737-3463 -- http://www.husted.com/struts/ Elena Yee wrote: Hi, I was wonder if the HTML generated by the Struts tag libraries are compatible in IE Netscape as well as on Windows, AIX, solaris HP systems? I don't seem to recall any documentation on this subject. Have anyone integrated and tested their applications on these platforms? Thanks, Elena -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Any Struts Reference Apps that implement DAO?
I'd like to implement the DAO pattern in a struts application I'm building - is anyone using this - if so, would you recommend? Also, what's the advantages/disadvantages for declaring your database parameters in struts-config.xml vs. web.xml? Thanks, Matt winmail.dat Description: application/ms-tnef -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Any Struts Reference Apps that implement DAO?
Not about DAO, but about the difference between web.xml and struts-config.xml: the first one is loaded by the container, reloading is a feature of the container, while the second one is loaded by Struts (ActionServlet), reloading it does not involve redeploying anything, you can just send a request to the Struts application to reload its configuration. Fr. -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED]] Sent: 30 November 2001 04:43 To: [EMAIL PROTECTED] Subject: Any Struts Reference Apps that implement DAO? I'd like to implement the DAO pattern in a struts application I'm building - is anyone using this - if so, would you recommend? Also, what's the advantages/disadvantages for declaring your database parameters in struts-config.xml vs. web.xml? Thanks, Matt File: ATT48491.txt The information in this email is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorised. If you are not an intended recipient, please notify the sender of this email immediately. You should not copy, use or disseminate the information contained in the email. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Capco. http://www.capco.com *** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re[2]: struts-config not found in Websphere 3.5.2 FixPack3
I have the myapp.webapp file in document root, but it must be in WEB-INF, I moved it to WEB-INF and it recognized the path for struts-config. Friday, November 30, 2001, 9:43:59 AM, you wrote: JR Hi, JR Have you added the ActionServlet mapping into your webapp name.webapp JR file? This mapping tells the action servlet where to find struts-config.xml. JR If you have the mapping what entry do you have for the config parameter? JR Jon Ridgway JR www.upco.co.uk JR -Original Message- JR From: jpablo [mailto:[EMAIL PROTECTED]] JR Sent: 30 November 2001 12:30 JR To: Struts Users Mailing List JR Subject: struts-config not found in Websphere 3.5.2 FixPack3 JR I'm configuring the Struts Action servlet on WebSphere 3.5.2 JR with fix pack 3, but I get an exception on startup (because this JR server uses loadonstartup). The servlet cant find the JR /WEB-INF/struts-config.xml file, JR I have the following file: JR /opt/IBMWebAS/hosts/default_host/myapp/web/WEB-INF/struts-config.xml file, JR And the documen root of my web application is: JR /opt/IBMWebAS/hosts/default_host/myapp/web/ JR It is ok? Where shold be placed struts-config.xml? IMHO this JR config is right.. but not working. Any suggestion or tip will be JR really appreciated. JR This is a fragment of default_servlet_stdout.log JR ---cut--- JR [01.11.30 10:04:39:385 GMT-02:00] e82f28da ServletInstan A SRVE0048I: JR Loading servlet: action JR [01.11.30 10:04:39:885 GMT-02:00] e82f28da WebGroup A SRVE0091I: JR [Servlet LOG]: action: init JR [01.11.30 10:04:39:987 GMT-02:00] e82f28da WebGroup A SRVE0091I: JR [Servlet LOG]: action: Loading application resources from res JR ource Cuida2Resources JR [01.11.30 10:04:39:990 GMT-02:00] e82f28da WebGroup A SRVE0091I: JR [Servlet LOG]: action: Initializing configuration from resour JR ce path /WEB-INF/struts-config.xml JR [01.11.30 10:04:40:005 GMT-02:00] e82f28da ServletInstan X Uncaught init() JR exception thrown by servlet {0}: {1} JR action JR javax.servlet.UnavailableException: Missing JR configuration resource for path /WEB-INF/struts-config. JR xml JR at JR org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1316) JR ---cut--- JR -- JR Juan Pablo Villaverde JR Tec. en Infraestructura de Redes JR Soluciones Punto Com S.A. JR http://www.spcom.com.ar JR -- JR To unsubscribe, e-mail: JR mailto:[EMAIL PROTECTED] JR For additional commands, e-mail: JR mailto:[EMAIL PROTECTED] JR -- JR To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] JR For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Juan Pablo Villaverde Tec. en Infraestructura de Redes Soluciones Punto Com S.A. http://www.spcom.com.ar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Directory structure of a Struts project
Sun's recommendation is to put them in WEB-INF or WEB-INF/tlds. --- Shri [EMAIL PROTECTED] wrote: really depends on the complexity of your application. If you have just a few action classes, it may be OK. If there are far too many action classes, then perhaps it is good to separate actions and beans. WEB-INF/'YOUR TAG LIB' is preferred to keeping taglib under WEB-INF/classes/ Shri -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, 30 November 2001 3:51 PM To: Struts Users Mailing List Subject: Directory structure of a Struts project Hi I have a configuration layout question. At the moment I have all my Java programs in one directory both beans and Action classes, ie WEB-INF/classes/com/iamtestdomain/testproject -(1) and my taglibs in a the directory WEB-INF/classes/taglib -(2) Is this a good way to organize things? Or should I perhaps have things setup like WEB-INF/classes/com/iamtestdomain/testproject/actions WEB-INF/classes/com/iamtestdomain/testproject/beans and I am not sure where to put my taglib directory, where is a good place for this? Cheers Tony -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Iterate Design Question
Consider a situation where you want to display a straght listing of items from a database. Something like where you would display a listing of 1-20 products on page 1, 21-40 on page 2, etc. There seem to be two ways this gets implemented. 1. Pull the entire table contents, store them into a container of sorts, refer to the container's listing from page to page (instead of hitting the database again. 2. Query the DB for only the contents you need on each request. So user request page 1, backend queries the the DB for products 1 - 20, returns it. If the user requests for page 2, the backend does the same process over again for products 21-40 and so on. My specific situation prevents me from doing the first approach because the result set is so large (takes too long to make that initial DB call) and the listing changes so often that it's possible a user may be view an inaccurate listing. In going forward w/ approach 2, I've been having some issues I'd like to bounce off anyone w/ experience in the matter. - Thought about using the PreparedStatement.setMaxRows() method, but if I do something like SELECT ... FROM Products WHERE..., I don't know if the statement is smart enough to optimize itself to only retrieve 20 products. The docs say that the excess rows are silently dropped, but I don't know if silently means it pulls all the records and only returns 20. If that is the case that would seem like I wouldn't get any performance gains (the DB still has to go through the process of retrieving all the records). I imagine that what silently means would be dictated by the driver. - I also thought about using database specific SQL statements to cap the size of the result set (ie the 'Limit' keyword in MySQL). This would be my least desired step as I don't want to get tied to a specific database. I'm not aware of any ANSI SQL commands that will do this. Anyone have any thoughts?
RE: Dynamically Developing HTML forms
I've thought about doing this, and let me know if I'm on the same track as you. What I'd like to do is to stream XML from my Action class that builds all the elements of my form - label, value, and control type (text, textarea, select) - from my form bean. Then an XSL stylesheet is applied (value held in bean as well) and walla, the only thing that is static is the XSL stylesheet. Is this similar to what you're trying to do? Matt --- Rajeev Singh [EMAIL PROTECTED] wrote: Hi Tom, By Dynamic generation I mean generation of WEB pages on Fly. If we generate web pages on fly I don't know how it can be included in the WAR. In my webapp I am having a fixed set of JSP's plus while application is running the users will create additional pages which are reports or new forms matching to their transactions/profiles. Its here that I am not getting how can I use Struts. Thanx, Rajeev -Original Message- From: Tom Lister [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 3:45 PM To: 'Rajeev Singh '; ''struts-user' ' Subject: RE: Dynamically Developing HTML forms Hi Rajeev No answers as I don't understand the question. I am really curious a to what you mean by a dynamically generated application as most of struts is aimed at dynamic content. Do you mean using introspection/reflection to build an app on the fly? -Original Message- From: Rajeev Singh To: 'struts-user' Sent: 11/30/01 10:12 AM Subject: FW: Dynamically Developing HTML forms Hi all , I am repeating my question as to is there I can create a web app using struts if I have to dynamically generate HTML forms as separate HTML pages from the application of WAR type. thanx -Original Message- From: Rajeev Singh [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 28, 2001 6:14 PM To: 'struts-user' Subject: Dynamically Developing HTML forms Hi, I have a query as to whether I can use Struts comfortably for an application wherein I have to generate HTML /JSP pages Dynamically. All these JSP's will have different names that too generated dynamically and not predecided names. I don't think we can WAR in this case so we cant follow Model 2 MVC and we have to go for Model 1. Thanx, Rajeev -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
HELP with accessing indexed, nested properties in Action
I have search the archive and seen this bounced around, but can't seem to find a complete working example. I have: FormBean where one property is an Array of SomeBean; SomeBean has three properties, two int, one string; FormBean inits properly with an Array of SomeBean (via another Action); form.jsp iterates over array of SomeBeans, creates indexed text input boxes. These display just fine. When I submit the form, the Action can't get at (or I don't understand how to access) the SomeBean Array. If I kick back to the form, the other form fields keep any changed values, but the SomeBean Array goes null. I've been banging my head on this forever, so I would really appreciate any help! I've got the nightly build from 11/28/01 running Thanks, --John -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Digester Util how to write to a xml file.
Hi, I the stuts-example that comes with struts 1.0 has an example that has a databsase servlet that reads from a XML file, did any one work using the digester util to write to a XML file if so could you post an example please. Regards. RK - Original Message - From: Matt Raible [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, November 30, 2001 9:44 AM Subject: RE: Dynamically Developing HTML forms I've thought about doing this, and let me know if I'm on the same track as you. What I'd like to do is to stream XML from my Action class that builds all the elements of my form - label, value, and control type (text, textarea, select) - from my form bean. Then an XSL stylesheet is applied (value held in bean as well) and walla, the only thing that is static is the XSL stylesheet. Is this similar to what you're trying to do? Matt --- Rajeev Singh [EMAIL PROTECTED] wrote: Hi Tom, By Dynamic generation I mean generation of WEB pages on Fly. If we generate web pages on fly I don't know how it can be included in the WAR. In my webapp I am having a fixed set of JSP's plus while application is running the users will create additional pages which are reports or new forms matching to their transactions/profiles. Its here that I am not getting how can I use Struts. Thanx, Rajeev -Original Message- From: Tom Lister [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 3:45 PM To: 'Rajeev Singh '; ''struts-user' ' Subject: RE: Dynamically Developing HTML forms Hi Rajeev No answers as I don't understand the question. I am really curious a to what you mean by a dynamically generated application as most of struts is aimed at dynamic content. Do you mean using introspection/reflection to build an app on the fly? -Original Message- From: Rajeev Singh To: 'struts-user' Sent: 11/30/01 10:12 AM Subject: FW: Dynamically Developing HTML forms Hi all , I am repeating my question as to is there I can create a web app using struts if I have to dynamically generate HTML forms as separate HTML pages from the application of WAR type. thanx -Original Message- From: Rajeev Singh [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 28, 2001 6:14 PM To: 'struts-user' Subject: Dynamically Developing HTML forms Hi, I have a query as to whether I can use Struts comfortably for an application wherein I have to generate HTML /JSP pages Dynamically. All these JSP's will have different names that too generated dynamically and not predecided names. I don't think we can WAR in this case so we cant follow Model 2 MVC and we have to go for Model 1. Thanx, Rajeev -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Dynamically Developing HTML forms
Reply to Rajeev: In your dynamic web site u probably will still have fixed type of pages with a predefined format e.g. Form, Report, Report with Graph etc. for say a Gold Customer etc, in which case these pages could be treated as templates. I believe that you would be choosing the appropriate template in an action depending on the customer type page type setup the bean which will populate the web page. If this is completely off the mark, are u talking about a Personalization Engine such as my.yahoo.com or engines which are sold by Open Market etc --- Matt Raible [EMAIL PROTECTED] wrote: I've thought about doing this, and let me know if I'm on the same track as you. What I'd like to do is to stream XML from my Action class that builds all the elements of my form - label, value, and control type (text, textarea, select) - from my form bean. Then an XSL stylesheet is applied (value held in bean as well) and walla, the only thing that is static is the XSL stylesheet. Is this similar to what you're trying to do? Matt --- Rajeev Singh [EMAIL PROTECTED] wrote: Hi Tom, By Dynamic generation I mean generation of WEB pages on Fly. If we generate web pages on fly I don't know how it can be included in the WAR. In my webapp I am having a fixed set of JSP's plus while application is running the users will create additional pages which are reports or new forms matching to their transactions/profiles. Its here that I am not getting how can I use Struts. Thanx, Rajeev -Original Message- From: Tom Lister [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 3:45 PM To: 'Rajeev Singh '; ''struts-user' ' Subject: RE: Dynamically Developing HTML forms Hi Rajeev No answers as I don't understand the question. I am really curious a to what you mean by a dynamically generated application as most of struts is aimed at dynamic content. Do you mean using introspection/reflection to build an app on the fly? -Original Message- From: Rajeev Singh To: 'struts-user' Sent: 11/30/01 10:12 AM Subject: FW: Dynamically Developing HTML forms Hi all , I am repeating my question as to is there I can create a web app using struts if I have to dynamically generate HTML forms as separate HTML pages from the application of WAR type. thanx -Original Message- From: Rajeev Singh [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 28, 2001 6:14 PM To: 'struts-user' Subject: Dynamically Developing HTML forms Hi, I have a query as to whether I can use Struts comfortably for an application wherein I have to generate HTML /JSP pages Dynamically. All these JSP's will have different names that too generated dynamically and not predecided names. I don't think we can WAR in this case so we cant follow Model 2 MVC and we have to go for Model 1. Thanx, Rajeev -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Directory structure of a Struts project
WEB-INF/classes/com/iamtestdomain/testproject -(1) and my taglibs in a the directory WEB-INF/classes/taglib -(2) Is this a good way to organize things? The project I'm working on is organized thusly under a com.foo. package: actions entities forms servlets taglibs utils with actions in actions, struts forms in forms, etc. Entities is my business entity classes and servlets currently only contains my subclass of ActionServlet. Joey -- Sent via jApache.org -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Is there a way to call a struts custom tag from your own custom tag?
Hi, My question is actually simple. I would like to write my own custom tag that, for example, builds a form using the struts custom tags. For example, I would like to write a tag like this one: myTabLib:mytag / Which, for example, does this: html:form action = myAction.do bean:message key = myLabel / html:text property = myField / /html:form This is just an example, I am not particularly interested in building a form. The key question is how to get your container to actually execute another custom tag from within your doStartTag() method for example. If you do out.print(bean:message key = \myLabel\ /), of course this will simply be sent back to the browser as is (text), without any interpretation on the server side. I don't know, maybe this is not doable at all, but thanks in advance for any suggestions, Hani. P.S: The thing is, if this is not doable, then using struts kinda prevents you from writing your own custom tags (unless you extend the struts stuff). I wanted to write my own custom tag which reads some data from the database, does a couple of things, and builds an html:select with the data. But that's exactly where I got stuck: at the html:select! Of course, the regular select would work just fine, but you do want to use the html:select for struts to populate your bean. So I ended up using a %@ include, at least for now. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: session id is same for different Browser
Rob, I did start two instances of the browser. later I even try logon from IE and Netscape separately, but I can also get same session ID. I also found sometimes I get the same session id, sametimes session id is different which is what I want. Thanks a lot. Gang -Original Message- From: Rob Breeds [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 3:39 AM To: Struts Users Mailing List Subject: RE: session id is same for different Browser You will see the same session ID for two browser windows if you 'clone' the browser window with CTRL+N (in IE). To get a separate session ID you need to start two instances of the browser, not clone the existing window. Rob Breeds bendiolas@nets cape.net To: [EMAIL PROTECTED] (Struts Users Mailing List) (Steve cc: Bendiola)Subject: RE: session id is same for different Browser 29/11/2001 20:55 Please respond to Struts Users Mailing List Gang, If you are using the same browser (opening 2 versions of IE, Netscape...), they could be sharing cookies, and thus the same session. Gao, Gang [EMAIL PROTECTED] wrote: Hi, I have a very strange case, When I logon to my site using two different Browser, I print out the session id and find it is same. Actully I open two different Browsers on same machine. How does it have same session id. Please help me out. I use struts and weblogic6.0 as web server. I put some value object in session, it looks like the second logon overwrite the first value object in session. Thanks a lot. Gang -- __ Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/ Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Dynamically Developing HTML forms
This sounds like more of what I'd like to do: http://www.mail-archive.com/struts-user@jakarta.apache.org/msg18542.html I'm just waiting for Jeff to publish his example ;-) Matt -Original Message- From: Rajan Gupta [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 8:23 AM To: [EMAIL PROTECTED] Subject: RE: Dynamically Developing HTML forms A servlet would be better than using a plain JSP, because coding debugging will be better, else u will have to write a lot os scriplets in your JSP code. U can still use Struts by forwarding to a servlet with two request parameters one for the XML document the other for the stylesheet, Xalan can be used to get the resulting output which can be then streamed to the response buffer. --- Matt Raible [EMAIL PROTECTED] wrote: Rajan, This sound about right. I'm just trying to get out of the manual labor in creating the data part of the view - via a JSP. I think this can all be XML, and the design can all be controlled via an XSL stylesheet (which will have to be created manually). Matt --- Rajan Gupta [EMAIL PROTECTED] wrote: Reply to Rajeev: In your dynamic web site u probably will still have fixed type of pages with a predefined format e.g. Form, Report, Report with Graph etc. for say a Gold Customer etc, in which case these pages could be treated as templates. I believe that you would be choosing the appropriate template in an action depending on the customer type page type setup the bean which will populate the web page. If this is completely off the mark, are u talking about a Personalization Engine such as my.yahoo.com or engines which are sold by Open Market etc --- Matt Raible [EMAIL PROTECTED] wrote: I've thought about doing this, and let me know if I'm on the same track as you. What I'd like to do is to stream XML from my Action class that builds all the elements of my form - label, value, and control type (text, textarea, select) - from my form bean. Then an XSL stylesheet is applied (value held in bean as well) and walla, the only thing that is static is the XSL stylesheet. Is this similar to what you're trying to do? Matt --- Rajeev Singh [EMAIL PROTECTED] wrote: Hi Tom, By Dynamic generation I mean generation of WEB pages on Fly. If we generate web pages on fly I don't know how it can be included in the WAR. In my webapp I am having a fixed set of JSP's plus while application is running the users will create additional pages which are reports or new forms matching to their transactions/profiles. Its here that I am not getting how can I use Struts. Thanx, Rajeev -Original Message- From: Tom Lister [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 3:45 PM To: 'Rajeev Singh '; ''struts-user' ' Subject: RE: Dynamically Developing HTML forms Hi Rajeev No answers as I don't understand the question. I am really curious a to what you mean by a dynamically generated application as most of struts is aimed at dynamic content. Do you mean using introspection/reflection to build an app on the fly? -Original Message- From: Rajeev Singh To: 'struts-user' Sent: 11/30/01 10:12 AM Subject: FW: Dynamically Developing HTML forms Hi all , I am repeating my question as to is there I can create a web app using struts if I have to dynamically generate HTML forms as separate HTML pages from the application of WAR type. thanx -Original Message- From: Rajeev Singh [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 28, 2001 6:14 PM To: 'struts-user' Subject: Dynamically Developing HTML forms Hi, I have a query as to whether I can use Struts comfortably for an application wherein I have to generate HTML /JSP pages Dynamically. All these JSP's will have different names that too generated dynamically and not predecided names. I don't think we can WAR in this case so we cant follow Model 2 MVC and we have to go for Model 1. Thanx, Rajeev -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just
Re: HELP with accessing indexed, nested properties in Action
I posted working example a while back. see http://www.mail-archive.com/struts-user@jakarta.apache.org/msg12084.html HTH, Dave John Kowalik [EMAIL PROTECTED] on 11/30/2001 09:45:39 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] cc:(bcc: David Hay/Lex/Lexmark) Subject: HELP with accessing indexed, nested properties in Action I have search the archive and seen this bounced around, but can't seem to find a complete working example. I have: FormBean where one property is an Array of SomeBean; SomeBean has three properties, two int, one string; FormBean inits properly with an Array of SomeBean (via another Action); form.jsp iterates over array of SomeBeans, creates indexed text input boxes. These display just fine. When I submit the form, the Action can't get at (or I don't understand how to access) the SomeBean Array. If I kick back to the form, the other form fields keep any changed values, but the SomeBean Array goes null. I've been banging my head on this forever, so I would really appreciate any help! I've got the nightly build from 11/28/01 running Thanks, --John -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Is there a way to call a struts custom tag from your own custom tag?
You could probably use findAncestorWithClass(Tag, Class) http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/jsp/tagext/TagSupport.html --- Hani Hamandi [EMAIL PROTECTED] wrote: Hi, My question is actually simple. I would like to write my own custom tag that, for example, builds a form using the struts custom tags. For example, I would like to write a tag like this one: myTabLib:mytag / Which, for example, does this: html:form action = myAction.do bean:message key = myLabel / html:text property = myField / /html:form This is just an example, I am not particularly interested in building a form. The key question is how to get your container to actually execute another custom tag from within your doStartTag() method for example. If you do out.print(bean:message key = \myLabel\ /), of course this will simply be sent back to the browser as is (text), without any interpretation on the server side. I don't know, maybe this is not doable at all, but thanks in advance for any suggestions, Hani. P.S: The thing is, if this is not doable, then using struts kinda prevents you from writing your own custom tags (unless you extend the struts stuff). I wanted to write my own custom tag which reads some data from the database, does a couple of things, and builds an html:select with the data. But that's exactly where I got stuck: at the html:select! Of course, the regular select would work just fine, but you do want to use the html:select for struts to populate your bean. So I ended up using a %@ include, at least for now. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Is there a way to call a struts custom tag from your own custom tag?
Oh, well, maybe I wasn't clear in my question. I want myTagLib:myTag / to somehow replace itself by a set of struts tags. I don't think findAncestor would do it. Am I missing something in your thoughts? Thanks for your answer anyway. -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 12:06 PM To: Struts Users Mailing List Subject: Re: Is there a way to call a struts custom tag from your own custom tag? You could probably use findAncestorWithClass(Tag, Class) http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/jsp/tagext/Ta gSupport.html --- Hani Hamandi [EMAIL PROTECTED] wrote: Hi, My question is actually simple. I would like to write my own custom tag that, for example, builds a form using the struts custom tags. For example, I would like to write a tag like this one: myTabLib:mytag / Which, for example, does this: html:form action = myAction.do bean:message key = myLabel / html:text property = myField / /html:form This is just an example, I am not particularly interested in building a form. The key question is how to get your container to actually execute another custom tag from within your doStartTag() method for example. If you do out.print(bean:message key = \myLabel\ /), of course this will simply be sent back to the browser as is (text), without any interpretation on the server side. I don't know, maybe this is not doable at all, but thanks in advance for any suggestions, Hani. P.S: The thing is, if this is not doable, then using struts kinda prevents you from writing your own custom tags (unless you extend the struts stuff). I wanted to write my own custom tag which reads some data from the database, does a couple of things, and builds an html:select with the data. But that's exactly where I got stuck: at the html:select! Of course, the regular select would work just fine, but you do want to use the html:select for struts to populate your bean. So I ended up using a %@ include, at least for now. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts 1.1 book available for order
http://www.atlasbooks.com/marktplc/00670.htm You can order it today, and it will ship next week. It will be on Amazon, etc. in a few more weeks, it takes time. This is the fastest way I know to publish it. Vic -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts 1.1 book available for order
I see the price is listed as $69.95! Do you know what the likely price on Amazon will be? -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 11:26 AM To: [EMAIL PROTECTED] Subject: Struts 1.1 book available for order http://www.atlasbooks.com/marktplc/00670.htm You can order it today, and it will ship next week. It will be on Amazon, etc. in a few more weeks, it takes time. This is the fastest way I know to publish it. Vic -- To unsubscribe, e-mail: mailto:struts-user-[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Digester Util how to write to a xml file.
The example updates the XML file so there must be code for you to browse. Lou Farho Certes Solutions, Inc. 2485 W MAIN ST SUITE 205 Littleton, CO 80120 303.798.8079 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: File Upload Problem.
Marli, Your multipart data seems to be right. Make sure you prefix it with the normal HTTP headers that go with a multipart request, I think something like: Content-Type: multipart/form-data; boundary=...\r\n --boundary -same stuff as you had for the multipart data goes here If you're still having this problem, would you mind sending me the stuff that you're using so I could take a look at it? -Original Message- From: Marli Satyadi [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 29, 2001 7:13 PM To: Struts Users Mailing List; 'Struts Users Mailing List' Subject: RE: File Upload Problem. Hi Jon, I am trying to do file upload programatically, not using the browser and I want to use the struts file upload library to achieve this. So I want to try the library first by writing a simple html file and a simple servlet for testing. Does this mean that I cannot use the upload code if I don't use struts tags ?? Thanks. Marli. At 09:42 AM 11/29/2001 +, Jon.Ridgway wrote: Hi Marli, I might be missing something here, but you don't appear to be using struts. Are you aware that there is a strurs tag for file upload? Have a look at the struts examples. Jon. -Original Message- From: Marli Satyadi [mailto:[EMAIL PROTECTED]] Sent: 29 November 2001 01:23 To: [EMAIL PROTECTED] Subject: File Upload Problem. Hello, I was writing some upload code to test the use of MultipartIterator class. My html code is as follows: - BODY BGCOLOR=FF h1 MULTIPART TEST/h1 FORM NAME=loadfile ACTION=/MDC/servlet/servlet/com.cisco.nm.callhome.servlet.TestServlet ENCTYPE='multipart/form-data' METHOD=POST CLASS: INPUT NAME=class TYPE=text VALUE=File br COMMAND: INPUT NAME=cmd TYPE=text VALUE=Add br DATA (XML): textarea name=dataParam rows=20 cols=80/textarea br File Location: INPUT TYPE=file NAME=uploadfile SIZE=50 br INPUT TYPE=SUBMIT NAME=SUBMIT /FORM /BODY /HTML My servlet code is as follows: --- protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException { LogUtil.debug(_Class, - DO POST); MultipartIterator iter = new MultipartIterator(req, 64*1024, Integer.MAX_VALUE, C:/Temp); MultipartElement elem = null; while( (elem = iter.getNextElement()) != null ) { if( elem.isFile() ) { System.out.println(ELEM is a file); System.out.println(FILENAME = + elem.getFileName()); System.out.println(FILE PATH = + elem.getFile().getAbsolutePath()); } else { System.out.print(NAME = ' + elem.getName() + '); System.out.println(. VALUE = ' + elem.getValue() + '); //System.out.println(elem.getName() + = + elem.getValue()); } } } When I use my browser to the html file, put some data in the dataParam text area and hit Submit, I got the following result in Tomcat stdout.log NAME = 'class'. VALUE = 'File' NAME = 'cmd'. VALUE = 'Add' /File'/AuthTupleswordbejo/Password1663eb7d56063ec67f23be/Checksum ELEM is a file FILENAME = ch-p506-2_enable_callhome.cfg FILE PATH = C:\Temp\strts4674.tmp NAME = 'SUBMIT'. VALUE = 'Submit Query' My question is: -- * Is there an explanation on why the dataParam parameter is not printed out, or printed out but has the wrong value ? * I also have written a Java multipart writer to test it, but it looks like that the file is always larger by 2 bytes. Isn't the format for multipart request like this: --Boundary\r\n content-disposition: form-data; name=blah; filename=file.txt\r\n Content-type: application/octet-stream\r\n \r\n Body goes here.. --Boundary--\r\n Am I correct about the CRLF (\r\n) ? I have read RFC 1867 and RFC 2046 and it looks correct. Any ideas ? Thanks in advance. Marli. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Is there a way to call a struts custom tag from your owncustom tag?
Hanikh, You can instantiate a tag from within a tag. You would need to set the appropriate tag setters like setParent and setPageContext. It may or may not work depending on how the tag was written. I also don't think it is an ideal way to nesting tags but it does work when the output of one tag changes enclosed tags. David Morris [EMAIL PROTECTED] 11/30/01 10:05AM Oh, well, maybe I wasn't clear in my question. I want myTagLib:myTag / to somehow replace itself by a set of struts tags. I don't think findAncestor would do it. Am I missing something in your thoughts? Thanks for your answer anyway. -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 12:06 PM To: Struts Users Mailing List Subject: Re: Is there a way to call a struts custom tag from your own custom tag? You could probably use findAncestorWithClass(Tag, Class) http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/jsp/tagext/Ta gSupport.html --- Hani Hamandi [EMAIL PROTECTED] wrote: Hi, My question is actually simple. I would like to write my own custom tag that, for example, builds a form using the struts custom tags. For example, I would like to write a tag like this one: myTabLib:mytag / Which, for example, does this: html:form action = myAction.do bean:message key = myLabel / html:text property = myField / /html:form This is just an example, I am not particularly interested in building a form. The key question is how to get your container to actually execute another custom tag from within your doStartTag() method for example. If you do out.print(bean:message key = \myLabel\ /), of course this will simply be sent back to the browser as is (text), without any interpretation on the server side. I don't know, maybe this is not doable at all, but thanks in advance for any suggestions, Hani. P.S: The thing is, if this is not doable, then using struts kinda prevents you from writing your own custom tags (unless you extend the struts stuff). I wanted to write my own custom tag which reads some data from the database, does a couple of things, and builds an html:select with the data. But that's exactly where I got stuck: at the html:select! Of course, the regular select would work just fine, but you do want to use the html:select for struts to populate your bean. So I ended up using a %@ include, at least for now. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts 1.1 book available for order
After seeing your table of contents I wonder about what is in this book. Which of the extensions that are not part of the official struts distribution does the book cover [i.e. Validator by David Winterfeldt, Tiles by Cedric Dumoulin, Role Based Actions by Nic Hobs, etc.]? Also, will there be a sample chapter to read on-line before deciding to purchase the book. I'd hate to spend $70 an find out I can't read it. I assume you will announce when Amazon will be carrying it as well. [It is much easier to buy from a company we have already established an account with at my company]. Nathan Anderson -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 9:26 AM To: [EMAIL PROTECTED] Subject: Struts 1.1 book available for order http://www.atlasbooks.com/marktplc/00670.htm You can order it today, and it will ship next week. It will be on Amazon, etc. in a few more weeks, it takes time. This is the fastest way I know to publish it. Vic -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Is there a way to call a struts custom tag from your own custom tag?
Thanks for your answer David. Again, maybe I was not clear in my original message, even though I thought I were. But I am really not trying to do nesting here. I am simply trying to write a custom tag: Normally, when you write a custom tag, the only tags you can use in out.print( ... ) are the plain old html tags. I want to be able, from within my custom tag, say in doStartTag(), to do something like out.print(html:someStrutsTag /) where html:someStrutsTag / is not simply written back to the browser as is, but actually evalutated on the server. Thanks again for your suggestion, Hani. -Original Message- From: David Morris [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 1:27 PM To: [EMAIL PROTECTED] Subject: RE: Is there a way to call a struts custom tag from your own custom tag? Hanikh, You can instantiate a tag from within a tag. You would need to set the appropriate tag setters like setParent and setPageContext. It may or may not work depending on how the tag was written. I also don't think it is an ideal way to nesting tags but it does work when the output of one tag changes enclosed tags. David Morris [EMAIL PROTECTED] 11/30/01 10:05AM Oh, well, maybe I wasn't clear in my question. I want myTagLib:myTag / to somehow replace itself by a set of struts tags. I don't think findAncestor would do it. Am I missing something in your thoughts? Thanks for your answer anyway. -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 12:06 PM To: Struts Users Mailing List Subject: Re: Is there a way to call a struts custom tag from your own custom tag? You could probably use findAncestorWithClass(Tag, Class) http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/jsp/tagext/Ta gSupport.html --- Hani Hamandi [EMAIL PROTECTED] wrote: Hi, My question is actually simple. I would like to write my own custom tag that, for example, builds a form using the struts custom tags. For example, I would like to write a tag like this one: myTabLib:mytag / Which, for example, does this: html:form action = myAction.do bean:message key = myLabel / html:text property = myField / /html:form This is just an example, I am not particularly interested in building a form. The key question is how to get your container to actually execute another custom tag from within your doStartTag() method for example. If you do out.print(bean:message key = \myLabel\ /), of course this will simply be sent back to the browser as is (text), without any interpretation on the server side. I don't know, maybe this is not doable at all, but thanks in advance for any suggestions, Hani. P.S: The thing is, if this is not doable, then using struts kinda prevents you from writing your own custom tags (unless you extend the struts stuff). I wanted to write my own custom tag which reads some data from the database, does a couple of things, and builds an html:select with the data. But that's exactly where I got stuck: at the html:select! Of course, the regular select would work just fine, but you do want to use the html:select for struts to populate your bean. So I ended up using a %@ include, at least for now. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Struts 1.1 book available for order
There is a chapter each on Validator and Tiles. In addition, there is an appendix on Validator and Tiles (the appendix is just a reprint of the web site's by Cedric and David). The full TOC is on baseBeans.net / book. Nothing on Role Based Actions. I do cover JDBC DB security realms (JAAS), XSLT, SQL/DB, etc. I guess in a while there will be posts from readers who completed the book. Also news.basebeans.com / mvc-programers will have student reviews of the people who took the class and read the book as well. I will announce Amazon. They will cary it for $89. Vic ps (Long answer why $89 for Amazon: A regular publisher takes something like 6 months to publish a book and gives you 10% and take all the rights mostly. So I kind of chose POD publishing (print on demand) where only 1,000 copies get printed at a time. But marketing is limited, so I have to register the book with Amazon after they build up stock (vs the web site that is pubishing it, that can do it today) which takes time. My current estimate is that a week after X-mass will it be on Amazon, and because Amazon takes %40 cut... prices is higher. They also will use a 2nd publisher. That's right, 1 book, 2 publishers. That is even a longer story. Once you publish a book you will find all the way's they get you. ) Nathan Anderson wrote: After seeing your table of contents I wonder about what is in this book. Which of the extensions that are not part of the official struts distribution does the book cover [i.e. Validator by David Winterfeldt, Tiles by Cedric Dumoulin, Role Based Actions by Nic Hobs, etc.]? Also, will there be a sample chapter to read on-line before deciding to purchase the book. I'd hate to spend $70 an find out I can't read it. I assume you will announce when Amazon will be carrying it as well. [It is much easier to buy from a company we have already established an account with at my company]. Nathan Anderson -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 9:26 AM To: [EMAIL PROTECTED] Subject: Struts 1.1 book available for order http://www.atlasbooks.com/marktplc/00670.htm You can order it today, and it will ship next week. It will be on Amazon, etc. in a few more weeks, it takes time. This is the fastest way I know to publish it. Vic -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Is there a way to call a struts custom tag from your own cu stom tag?
In other words, if, for example, you do out.print(html:text ... /), this will simply write the actual string html:text ... / back to the browser, and, of course, not evaluate the tag. I was just wondering if there's a way to do it. -Original Message- From: Hani Hamandi [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 1:51 PM To: 'Struts Users Mailing List' Subject: RE: Is there a way to call a struts custom tag from your own cu stom tag? Thanks for your answer David. Again, maybe I was not clear in my original message, even though I thought I were. But I am really not trying to do nesting here. I am simply trying to write a custom tag: Normally, when you write a custom tag, the only tags you can use in out.print( ... ) are the plain old html tags. I want to be able, from within my custom tag, say in doStartTag(), to do something like out.print(html:someStrutsTag /) where html:someStrutsTag / is not simply written back to the browser as is, but actually evalutated on the server. Thanks again for your suggestion, Hani. -Original Message- From: David Morris [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 1:27 PM To: [EMAIL PROTECTED] Subject: RE: Is there a way to call a struts custom tag from your own custom tag? Hanikh, You can instantiate a tag from within a tag. You would need to set the appropriate tag setters like setParent and setPageContext. It may or may not work depending on how the tag was written. I also don't think it is an ideal way to nesting tags but it does work when the output of one tag changes enclosed tags. David Morris [EMAIL PROTECTED] 11/30/01 10:05AM Oh, well, maybe I wasn't clear in my question. I want myTagLib:myTag / to somehow replace itself by a set of struts tags. I don't think findAncestor would do it. Am I missing something in your thoughts? Thanks for your answer anyway. -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 12:06 PM To: Struts Users Mailing List Subject: Re: Is there a way to call a struts custom tag from your own custom tag? You could probably use findAncestorWithClass(Tag, Class) http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/jsp/tagext/Ta gSupport.html --- Hani Hamandi [EMAIL PROTECTED] wrote: Hi, My question is actually simple. I would like to write my own custom tag that, for example, builds a form using the struts custom tags. For example, I would like to write a tag like this one: myTabLib:mytag / Which, for example, does this: html:form action = myAction.do bean:message key = myLabel / html:text property = myField / /html:form This is just an example, I am not particularly interested in building a form. The key question is how to get your container to actually execute another custom tag from within your doStartTag() method for example. If you do out.print(bean:message key = \myLabel\ /), of course this will simply be sent back to the browser as is (text), without any interpretation on the server side. I don't know, maybe this is not doable at all, but thanks in advance for any suggestions, Hani. P.S: The thing is, if this is not doable, then using struts kinda prevents you from writing your own custom tags (unless you extend the struts stuff). I wanted to write my own custom tag which reads some data from the database, does a couple of things, and builds an html:select with the data. But that's exactly where I got stuck: at the html:select! Of course, the regular select would work just fine, but you do want to use the html:select for struts to populate your bean. So I ended up using a %@ include, at least for now. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts 1.1 book available for order
Hi Looks just the book I've been waiting for but at $80/$90 - twice the price of most IT books - I'd need to see some sample content first. -Original Message- From: Vic Cekvenich To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Sent: 30/11/01 18:53 Subject: Re: Struts 1.1 book available for order There is a chapter each on Validator and Tiles. In addition, there is an appendix on Validator and Tiles (the appendix is just a reprint of the web site's by Cedric and David). The full TOC is on baseBeans.net / book. Nothing on Role Based Actions. I do cover JDBC DB security realms (JAAS), XSLT, SQL/DB, etc. I guess in a while there will be posts from readers who completed the book. Also news.basebeans.com / mvc-programers will have student reviews of the people who took the class and read the book as well. I will announce Amazon. They will cary it for $89. Vic ps (Long answer why $89 for Amazon: A regular publisher takes something like 6 months to publish a book and gives you 10% and take all the rights mostly. So I kind of chose POD publishing (print on demand) where only 1,000 copies get printed at a time. But marketing is limited, so I have to register the book with Amazon after they build up stock (vs the web site that is pubishing it, that can do it today) which takes time. My current estimate is that a week after X-mass will it be on Amazon, and because Amazon takes %40 cut... prices is higher. They also will use a 2nd publisher. That's right, 1 book, 2 publishers. That is even a longer story. Once you publish a book you will find all the way's they get you. ) Nathan Anderson wrote: After seeing your table of contents I wonder about what is in this book. Which of the extensions that are not part of the official struts distribution does the book cover [i.e. Validator by David Winterfeldt, Tiles by Cedric Dumoulin, Role Based Actions by Nic Hobs, etc.]? Also, will there be a sample chapter to read on-line before deciding to purchase the book. I'd hate to spend $70 an find out I can't read it. I assume you will announce when Amazon will be carrying it as well. [It is much easier to buy from a company we have already established an account with at my company]. Nathan Anderson -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 9:26 AM To: [EMAIL PROTECTED] Subject: Struts 1.1 book available for order http://www.atlasbooks.com/marktplc/00670.htm You can order it today, and it will ship next week. It will be on Amazon, etc. in a few more weeks, it takes time. This is the fastest way I know to publish it. Vic -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Missing message for key index.title getResourceAsStream()
When I try to run the struts-example in Tomcat 4.0 (jre 1.3.1, NT 4, SP6) I get the infamous Missing message for key index.title I notice tho, that the logs have an earlier exception trying to load /WEB-INF/struts-config.xml: 2001-11-30 12:45:39 action: Initializing configuration from resource path /WEB-INF/struts-config.xml 2001-11-30 12:45:39 StandardWrapper[/struts-example:action]: Marking servlet action as unavailable 2001-11-30 12:45:39 StandardContext[/struts-example]: Servlet /struts-example threw load() exception javax.servlet.UnavailableException: Missing configuration resource for path /WEB-INF/struts-config.xml at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1316) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:465) ... The error is coming in ActionServlet.initMapping on the lines: InputStream input = getServletContext().getResourceAsStream(config); if (input == null) throw new UnavailableException (internal.getMessage(configMissing, config)); For some reason the getResourceAsStream() call is failing. The xml file IS there and I tried a lot of (valid) variations on the location and name and they all fail. There seems to be something wrong with getResourceAsStream(). Is this because it is in the init of the servlet? Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Is there a way to call a struts custom tag from your owncustom tag?
Hani, I still must not understand, but I think that your someStrutsTag is indeed nested in your tag. At least the output is. You may be able to get away with something like: if (getSomeStrutsTag() == null) { setSomeStrutsTag()(new SomeStrutsTag()); getSomeStrutsTag().setParent(this); getSomeStrutsTag().setPageContext(pageContext); getSomeStrutsTag().setWhateverelse(); } // You should probably use reflection to see what is available and then // do something like this for the appropriate pieces: getSomeStrutsTag().doStartTag(); You would put this code in the doStart or doEnd of your own tag. I still don't think this is real good practice, but it should work. David Morris [EMAIL PROTECTED] 11/30/01 11:50AM Thanks for your answer David. Again, maybe I was not clear in my original message, even though I thought I were. But I am really not trying to do nesting here. I am simply trying to write a custom tag: Normally, when you write a custom tag, the only tags you can use in out.print( ... ) are the plain old html tags. I want to be able, from within my custom tag, say in doStartTag(), to do something like out.print(html:someStrutsTag /) where html:someStrutsTag / is not simply written back to the browser as is, but actually evalutated on the server. Thanks again for your suggestion, Hani. -Original Message- From: David Morris [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 1:27 PM To: [EMAIL PROTECTED] Subject: RE: Is there a way to call a struts custom tag from your own custom tag? Hanikh, You can instantiate a tag from within a tag. You would need to set the appropriate tag setters like setParent and setPageContext. It may or may not work depending on how the tag was written. I also don't think it is an ideal way to nesting tags but it does work when the output of one tag changes enclosed tags. David Morris -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Passing information to the jsp
If you want to pass data to a jsp, where the information will not be in an HTML form, do I need to pass it through the ActionForm that is in the mapping, or should I just put a bean in the request and use it on the jsp? Dave
My first Struts question
All, I've just subscribed to the Struts Users mailing list, so Hello, all! I also took the time to try to get the FAQ for the list and to find a searchable archive but the mailing list faq is non-existant (according to ezmlm). I've looked at the Jakarta site and I'm still needing a push in the right direction. I'm building my first Stuts app to learn more about it and at the moment I'm trying to use the html options JSP tag like so: html:select property=opponentName html:options collection=opponents property=username labelProperty=username/ /html:select The action form for this JSP has the following method: public ArrayList getOpponents() { PlayerController playerController = new PlayerController(); ArrayList list = playerController.getOpponents(ourName); return list; } Unfortunately, I get the following error: javax.servlet.ServletException: Cannot find bean under name opponents If I manually create a list on the JSP and stick on the page context like so: % // ... // create list // ... pageContext.setAttribute(opponents, list); % ...Then the page renders. Am I missing something? How can I get the options tag to find the collection within the form? (Or am I completely bonkers thinking that the options tag is supposed to look for the array in various places? Perhaps I need to change html:options collection=opponents... to something like html:options collection=form.opponents... It just occurred to me to look in the bug database at jakarta.apache.org... I think I might be describing Bugzilla Bug 905 2096... If so, how can I, on the JSP, get to the ActionForm object so that I can do a setAttribute? Any help? += Jeff Knee -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Logic Tag question
Hi, Any ideas on what tag, or how to compare to attributes from my form bean? Typically I would do logic:greaterThan property=number value=7 A little lower... /logic:greaterThan But, I need to see to compare two properties. Thanks, Beth. This message contains information which may be confidential and privileged. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose to anyone the message or any information contained in the message. If you have received the message in error, please advise the sender by reply e-mail, and delete or destroy the message. Thank you. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Iterate Design Question
Use a cursor. MySQL does it with: SELECT name FROM customers LIMIT 5, 10 Yes, it's optimized. http://www.mysql.com/doc/L/I/LIMIT_optimisation.html All databases can do that, maybe differently. --Renaud - Original Message - From: John M. Corro [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 30, 2001 8:43 AM Subject: Iterate Design Question Consider a situation where you want to display a straght listing of items from a database. Something like where you would display a listing of 1-20 products on page 1, 21-40 on page 2, etc. There seem to be two ways this gets implemented. 1. Pull the entire table contents, store them into a container of sorts, refer to the container's listing from page to page (instead of hitting the database again. 2. Query the DB for only the contents you need on each request. So user request page 1, backend queries the the DB for products 1 - 20, returns it. If the user requests for page 2, the backend does the same process over again for products 21-40 and so on. My specific situation prevents me from doing the first approach because the result set is so large (takes too long to make that initial DB call) and the listing changes so often that it's possible a user may be view an inaccurate listing. In going forward w/ approach 2, I've been having some issues I'd like to bounce off anyone w/ experience in the matter. - Thought about using the PreparedStatement.setMaxRows() method, but if I do something like SELECT ... FROM Products WHERE..., I don't know if the statement is smart enough to optimize itself to only retrieve 20 products. The docs say that the excess rows are silently dropped, but I don't know if silently means it pulls all the records and only returns 20. If that is the case that would seem like I wouldn't get any performance gains (the DB still has to go through the process of retrieving all the records). I imagine that what silently means would be dictated by the driver. - I also thought about using database specific SQL statements to cap the size of the result set (ie the 'Limit' keyword in MySQL). This would be my least desired step as I don't want to get tied to a specific database. I'm not aware of any ANSI SQL commands that will do this. Anyone have any thoughts? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Passing information to the jsp
If you want to pass data to a jsp, where the information will not be in an HTML form, do I need to pass it through the ActionForm that is in the mapping, or should I just put a bean in the request and use it on the jsp? If you need to pass info that won't be in the form, then I would think it perfectly acceptable to send it in the request using setAttribute(). There's no reason to clutter up your form code with getters/setters for data that your actions don't need. Joey -- Sent via jApache.org -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Is there a way to call a struts custom tag from your own custom tag?
I think the shourt answer is, No. However, what David is saying should get the job done. For instance I wanted a tag that would allow you to say mytags:validatedText property=name / and would output html:text property=name /html:errors property=name / so I wrote a tag that extends the Struts Text tag and has an Errors tag. Here is the source: public class InputTextTag extends TextTag { public int doStartTag() throws JspException { super.doStartTag(); ErrorsTag errorsTag = new ErrorsTag(); errorsTag.setPageContext(pageContext); errorsTag.setProperty(property); return errorsTag.doStartTag(); } } So the line that says super.doStartTag() will end up doing what html:text property=name/ would do and the errorsTag.doStartTag() will do the the html:errors property=name / Hope this helps. -Jonathan - Original Message - From: Hani Hamandi [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, November 30, 2001 12:50 PM Subject: RE: Is there a way to call a struts custom tag from your own custom tag? Thanks for your answer David. Again, maybe I was not clear in my original message, even though I thought I were. But I am really not trying to do nesting here. I am simply trying to write a custom tag: Normally, when you write a custom tag, the only tags you can use in out.print( ... ) are the plain old html tags. I want to be able, from within my custom tag, say in doStartTag(), to do something like out.print(html:someStrutsTag /) where html:someStrutsTag / is not simply written back to the browser as is, but actually evalutated on the server. Thanks again for your suggestion, Hani. -Original Message- From: David Morris [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 1:27 PM To: [EMAIL PROTECTED] Subject: RE: Is there a way to call a struts custom tag from your own custom tag? Hanikh, You can instantiate a tag from within a tag. You would need to set the appropriate tag setters like setParent and setPageContext. It may or may not work depending on how the tag was written. I also don't think it is an ideal way to nesting tags but it does work when the output of one tag changes enclosed tags. David Morris [EMAIL PROTECTED] 11/30/01 10:05AM Oh, well, maybe I wasn't clear in my question. I want myTagLib:myTag / to somehow replace itself by a set of struts tags. I don't think findAncestor would do it. Am I missing something in your thoughts? Thanks for your answer anyway. -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 12:06 PM To: Struts Users Mailing List Subject: Re: Is there a way to call a struts custom tag from your own custom tag? You could probably use findAncestorWithClass(Tag, Class) http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/jsp/tagext/Ta gSupport.html --- Hani Hamandi [EMAIL PROTECTED] wrote: Hi, My question is actually simple. I would like to write my own custom tag that, for example, builds a form using the struts custom tags. For example, I would like to write a tag like this one: myTabLib:mytag / Which, for example, does this: html:form action = myAction.do bean:message key = myLabel / html:text property = myField / /html:form This is just an example, I am not particularly interested in building a form. The key question is how to get your container to actually execute another custom tag from within your doStartTag() method for example. If you do out.print(bean:message key = \myLabel\ /), of course this will simply be sent back to the browser as is (text), without any interpretation on the server side. I don't know, maybe this is not doable at all, but thanks in advance for any suggestions, Hani. P.S: The thing is, if this is not doable, then using struts kinda prevents you from writing your own custom tags (unless you extend the struts stuff). I wanted to write my own custom tag which reads some data from the database, does a couple of things, and builds an html:select with the data. But that's exactly where I got stuck: at the html:select! Of course, the regular select would work just fine, but you do want to use the html:select for struts to populate your bean. So I ended up using a %@ include, at least for now. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: My first Struts question
Jeff, Welcome to the list. You can find the searchable archive at; http://www.mail-archive.com/struts-user@jakarta.apache.org/ Thanks. -- Original Message -- All, I've just subscribed to the Struts Users mailing list, so Hello, all! I also took the time to try to get the FAQ for the list and to find a searchable archive but the mailing list faq is non-existant (according to ezmlm). I've looked at the Jakarta site and I'm still needing a push in the right direction. I'm building my first Stuts app to learn more about it and at the moment I'm trying to use the html options JSP tag like so: html:select property=opponentName html:options collection=opponents property=username labelProperty=username/ /html:select The action form for this JSP has the following method: public ArrayList getOpponents() { PlayerController playerController = new PlayerController(); ArrayList list = playerController.getOpponents(ourName); return list; } Unfortunately, I get the following error: javax.servlet.ServletException: Cannot find bean under name opponents If I manually create a list on the JSP and stick on the page context like so: % // ... // create list // ... pageContext.setAttribute(opponents, list); % ...Then the page renders. Am I missing something? How can I get the options tag to find the collection within the form? (Or am I completely bonkers thinking that the options tag is supposed to look for the array in various places? Perhaps I need to change html:options collection=opponents... to something like html:options collection=form.opponents... It just occurred to me to look in the bug database at jakarta.apache.org... I think I might be describing Bugzilla Bug 905 2096... If so, how can I, on the JSP, get to the ActionForm object so that I can do a setAttribute? Any help? += Jeff Knee -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Ajay Chitre Diligent Team, Inc. (Where Diligent People Work as a Team) http://www.DiligentTeam.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Is there a way to call a struts custom tag from your own custom tag?
This is very cool! And if the tag you're calling (ErrorTag in your case) were more complicated, I would assume you would have to do the processing yourself, right? In other words, in your case, you happened to match ErrorsTag by simply calling its doStartTag(). But if, let's say, it implemented more methods than simply doStartTag (like doAfterBody, doEndTag ..), you would probably have to call these yourself one after the other, and check the return values of each. Thanks! -Original Message- From: Jonathan James [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 3:39 PM To: Struts Users Mailing List Subject: Re: Is there a way to call a struts custom tag from your own custom tag? I think the shourt answer is, No. However, what David is saying should get the job done. For instance I wanted a tag that would allow you to say mytags:validatedText property=name / and would output html:text property=name /html:errors property=name / so I wrote a tag that extends the Struts Text tag and has an Errors tag. Here is the source: public class InputTextTag extends TextTag { public int doStartTag() throws JspException { super.doStartTag(); ErrorsTag errorsTag = new ErrorsTag(); errorsTag.setPageContext(pageContext); errorsTag.setProperty(property); return errorsTag.doStartTag(); } } So the line that says super.doStartTag() will end up doing what html:text property=name/ would do and the errorsTag.doStartTag() will do the the html:errors property=name / Hope this helps. -Jonathan - Original Message - From: Hani Hamandi [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, November 30, 2001 12:50 PM Subject: RE: Is there a way to call a struts custom tag from your own custom tag? Thanks for your answer David. Again, maybe I was not clear in my original message, even though I thought I were. But I am really not trying to do nesting here. I am simply trying to write a custom tag: Normally, when you write a custom tag, the only tags you can use in out.print( ... ) are the plain old html tags. I want to be able, from within my custom tag, say in doStartTag(), to do something like out.print(html:someStrutsTag /) where html:someStrutsTag / is not simply written back to the browser as is, but actually evalutated on the server. Thanks again for your suggestion, Hani. -Original Message- From: David Morris [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 1:27 PM To: [EMAIL PROTECTED] Subject: RE: Is there a way to call a struts custom tag from your own custom tag? Hanikh, You can instantiate a tag from within a tag. You would need to set the appropriate tag setters like setParent and setPageContext. It may or may not work depending on how the tag was written. I also don't think it is an ideal way to nesting tags but it does work when the output of one tag changes enclosed tags. David Morris [EMAIL PROTECTED] 11/30/01 10:05AM Oh, well, maybe I wasn't clear in my question. I want myTagLib:myTag / to somehow replace itself by a set of struts tags. I don't think findAncestor would do it. Am I missing something in your thoughts? Thanks for your answer anyway. -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 12:06 PM To: Struts Users Mailing List Subject: Re: Is there a way to call a struts custom tag from your own custom tag? You could probably use findAncestorWithClass(Tag, Class) http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/jsp/tagext/Ta gSupport.html --- Hani Hamandi [EMAIL PROTECTED] wrote: Hi, My question is actually simple. I would like to write my own custom tag that, for example, builds a form using the struts custom tags. For example, I would like to write a tag like this one: myTabLib:mytag / Which, for example, does this: html:form action = myAction.do bean:message key = myLabel / html:text property = myField / /html:form This is just an example, I am not particularly interested in building a form. The key question is how to get your container to actually execute another custom tag from within your doStartTag() method for example. If you do out.print(bean:message key = \myLabel\ /), of course this will simply be sent back to the browser as is (text), without any interpretation on the server side. I don't know, maybe this is not doable at all, but thanks in advance for any suggestions, Hani. P.S: The thing is, if this is not doable, then using struts kinda prevents you from writing your own custom tags (unless you extend the struts stuff). I wanted to write my own custom tag which reads some data from the database, does a couple of things, and builds an html:select with the data. But that's exactly where I got stuck: at the html:select! Of course, the regular select would work just
Re: Struts 1.1 book available for order
I guess I'd better order a copy right away, so that I can find out what we're going to be implementing in Struts 1.1 ... ;-) -- Martin Cooper At 09:25 AM 11/30/01, Vic Cekvenich wrote: http://www.atlasbooks.com/marktplc/00670.htm You can order it today, and it will ship next week. It will be on Amazon, etc. in a few more weeks, it takes time. This is the fastest way I know to publish it. Vic -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts 1.1 book available for order
What is the email address for posting a question to the user group? I subscribed but am not clear how to post or reply to a question? Thanks, George White email: [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 3:00 PM To: Struts Users Mailing List Subject: Re: Struts 1.1 book available for order I guess I'd better order a copy right away, so that I can find out what we're going to be implementing in Struts 1.1 ... ;-) -- Martin Cooper At 09:25 AM 11/30/01, Vic Cekvenich wrote: http://www.atlasbooks.com/marktplc/00670.htm You can order it today, and it will ship next week. It will be on Amazon, etc. in a few more weeks, it takes time. This is the fastest way I know to publish it. Vic -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Is there a way to call a struts custom tag from your own custom tag?
Something like that. You would probably call the doAfterBody in your own doAfterBody, etc rather than one after the other, but yeah, that's the idea. There might be another way to do this, but this is what I did. -Jonathan - Original Message - From: Hani Hamandi [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, November 30, 2001 2:48 PM Subject: RE: Is there a way to call a struts custom tag from your own custom tag? This is very cool! And if the tag you're calling (ErrorTag in your case) were more complicated, I would assume you would have to do the processing yourself, right? In other words, in your case, you happened to match ErrorsTag by simply calling its doStartTag(). But if, let's say, it implemented more methods than simply doStartTag (like doAfterBody, doEndTag ..), you would probably have to call these yourself one after the other, and check the return values of each. Thanks! -Original Message- From: Jonathan James [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 3:39 PM To: Struts Users Mailing List Subject: Re: Is there a way to call a struts custom tag from your own custom tag? I think the shourt answer is, No. However, what David is saying should get the job done. For instance I wanted a tag that would allow you to say mytags:validatedText property=name / and would output html:text property=name /html:errors property=name / so I wrote a tag that extends the Struts Text tag and has an Errors tag. Here is the source: public class InputTextTag extends TextTag { public int doStartTag() throws JspException { super.doStartTag(); ErrorsTag errorsTag = new ErrorsTag(); errorsTag.setPageContext(pageContext); errorsTag.setProperty(property); return errorsTag.doStartTag(); } } So the line that says super.doStartTag() will end up doing what html:text property=name/ would do and the errorsTag.doStartTag() will do the the html:errors property=name / Hope this helps. -Jonathan - Original Message - From: Hani Hamandi [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, November 30, 2001 12:50 PM Subject: RE: Is there a way to call a struts custom tag from your own custom tag? Thanks for your answer David. Again, maybe I was not clear in my original message, even though I thought I were. But I am really not trying to do nesting here. I am simply trying to write a custom tag: Normally, when you write a custom tag, the only tags you can use in out.print( ... ) are the plain old html tags. I want to be able, from within my custom tag, say in doStartTag(), to do something like out.print(html:someStrutsTag /) where html:someStrutsTag / is not simply written back to the browser as is, but actually evalutated on the server. Thanks again for your suggestion, Hani. -Original Message- From: David Morris [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 1:27 PM To: [EMAIL PROTECTED] Subject: RE: Is there a way to call a struts custom tag from your own custom tag? Hanikh, You can instantiate a tag from within a tag. You would need to set the appropriate tag setters like setParent and setPageContext. It may or may not work depending on how the tag was written. I also don't think it is an ideal way to nesting tags but it does work when the output of one tag changes enclosed tags. David Morris [EMAIL PROTECTED] 11/30/01 10:05AM Oh, well, maybe I wasn't clear in my question. I want myTagLib:myTag / to somehow replace itself by a set of struts tags. I don't think findAncestor would do it. Am I missing something in your thoughts? Thanks for your answer anyway. -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 12:06 PM To: Struts Users Mailing List Subject: Re: Is there a way to call a struts custom tag from your own custom tag? You could probably use findAncestorWithClass(Tag, Class) http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/jsp/tagext/Ta gSupport.html --- Hani Hamandi [EMAIL PROTECTED] wrote: Hi, My question is actually simple. I would like to write my own custom tag that, for example, builds a form using the struts custom tags. For example, I would like to write a tag like this one: myTabLib:mytag / Which, for example, does this: html:form action = myAction.do bean:message key = myLabel / html:text property = myField / /html:form This is just an example, I am not particularly interested in building a form. The key question is how to get your container to actually execute another custom tag from within your doStartTag() method for example. If you do out.print(bean:message key = \myLabel\ /), of course this will simply be
html:radio problems
Hi, I'm having a problem using the html:radio tag using another bean. For my text fields, I define an object bean called User and set the value using: html:text name=User property=name/ This sets the value of the text field to whatever the getName() method of my form returns. When I try to do the same thing with my radio buttons: html:radio name=User property=flag value=TRUE/ true html:radio name=User property=flag value=FALSE/ false I get the following exception: javax.servlet.ServletException: No getter method available for property flag for bean under name User I can use text boxes, selects, and textareas using this method and they all work properly, so why does this not work with radio buttons? Chris Book -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: html:radio problems
Hi Chris, Make sure you have getFlag() and setFlag() methods in your User bean. The error says that it can't find the getFlag() method. In the example you gave for property=name, I'm sure you have getName() and setName methods in your User bean. Hope this helps, Lucas -Original Message- From: Christopher Book [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 11:36 AM To: '[EMAIL PROTECTED]' Subject: html:radio problems Hi, I'm having a problem using the html:radio tag using another bean. For my text fields, I define an object bean called User and set the value using: html:text name=User property=name/ This sets the value of the text field to whatever the getName() method of my form returns. When I try to do the same thing with my radio buttons: html:radio name=User property=flag value=TRUE/ true html:radio name=User property=flag value=FALSE/ false I get the following exception: javax.servlet.ServletException: No getter method available for property flag for bean under name User I can use text boxes, selects, and textareas using this method and they all work properly, so why does this not work with radio buttons? Chris Book -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Removing all beans from a session
session.invalidate() @see http://java.sun.com/j2ee/j2sdkee/techdocs/api/javax/servlet/http/HttpSession .html#invalidate() - Original Message - From: [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, November 29, 2001 10:38 PM Subject: Removing all beans from a session Hi Folks Whats the best way to remove all beans in a session? Should I use getAttributeNames() and then loop through this and delete each one or is there a quicker way? Cheers Tony -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Missing message for key index.title - Problem Found
I found the problem, at least in my installation, and maybe for others. I have security turned on. This causes all the application accesses to local files (e.g., properties, struts-config.xml, etc.) to fail. This isn't apparent since many of the methods seem to silently swallow the security exception. Unfortunately, I can't see how to fix this. It should be possible to fix it by granting permission in catalina.policy, but the spec to give struts.jar permission, e.g.: grant codeBase file:${catalina.home}/webapps/struts-example/WEB-INF/lib/- { permission java.security.AllPermission; }; doesn't work because of a Tomcat bug loading libraries from /WEB-INF/lib. Moving the lib to tomcat/common/lib also seems to have problems with derived classes in the /WEB-INF/classes classes. Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Missing message for key index.title - Workaround
One way to workarounf the Tomcat security bug in loading libs is to explode struts.jar into your /WEB-INF/classes directory. Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[ANN] BOOK: Open Standards Software: Tomcat / Struts / MVC Book and Training
[PUBLIC/PRIVATE TRAINING] BaseBeans Engineering offers both public and private training classes in developing MVC applications using the Struts framework and other open standards software. Please visit the BaseBeans web site for more information (http://www.basebeans.com). [BOOK] BaseBeans Engineering is announcing the widespread availability of the book Struts Fast Track: J2EE/JSP Framework, covering the necessities of developing open standards, MVC, Struts-based applications, including open standard software overviews, database CRUD, object orientation, tiles, menus, security, refactoring, and deployment. Struts Fast Track may be purchased at Atlas Books (http://www.atlasbooks.com/marktplc/00670.htm). TABLE OF CONTENTS Chapter 1: Orientation Chapter 2: Warm Up Chapter 3: Requirements Chapter 4: Framework Installation Chapter 5: Support Chapter 6: Application Architecture Chapter 7: Searching Chapter 8: Setup RDBMS Chapter 9: Data Retrieval Chapter 10: Object Orientation Chapter 11: XML from JSP Chapter 12: Drill Down Chapter 13: Debugging Chapter 14: Data Entry Chapter 15: Master-Detail Processing Chapter 16: Security Chapter 17: Demo Chapter 18: Data Validation Chapter 19: Administration Chapter 20: Portal Tiles Chapter 21: Refactoring Chapter 22: Menus Chapter 23: Deployment Chapter 24: Performance Assurance Chapter 25: Audit Queue Chapter 26: Content Syndication Chapter 27: Review Appendix A: Downloads Appendix B: Technology Architecture Appendix C: Struts Tiles Appendix D: Struts Validation Appendix E: WebLogic Deployment Appendix F: Why not use ... ? [MORE INFORMATION] For more information, please visit the BaseBeans Engineering web site (http://www.basebeans.com). -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
findDataSource
Here's my setup: MacOS X Tomcat 4 (but also happens with orion) MySQL 3.23.43 data-sources data-source set-property property=driverClass value=org.gjt.mm.mysql.Driver / set-property property=password value=root / set-property property=user value=root / set-property property=url value=jdbc:mysql://127.0.0.1:3306/eds / /data-source /data-sources Everything works fine, until I run the following piece of code: DataSource dataSource = servlet.findDataSource(null); Connection conn = dataSource.getConnection(); findDataSource gives me this error: java.lang.NullPointerException I presume it can't find the datasource. Howevere, I know that the mm driver is working fine and it can contact the database, since the application is at least able to startup. Can anyone figure out what's happening? -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
X2J : New Code generation tool for Struts
X2J is a code generation tool for building Struts applications. It includes wizard for easily creating JSPs, and the required Action and ActionForm classes as well as graphical tools for updating the config file. You can check it out at http://www.objectwave.com Once there just got to tools/java -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts Multibox
I need a form that has checkboxes (multiboxes) for all the states. First I would like to know if the parameters of the multibox allow one to save the names (state name) of the checkboxes along with an indication of whether they are checked or unchecked Too, I need to save to a database and redisplay the entire set of checkboxes, both checked and unchecked. If anyone has any sample code of arrays iterators (for the java code) and what it takes to display it (JSP) -- would be very much appreciated? Thanks, George
Struts and returning NOCONTENT
Hi, in my application, after a specific post, I'm setting the NOCONTENT (204) status so that the browser doesn't refresh anything, and everythings working, but I find that Internet Explorer keeps its status bar incrementing, as thou its wanting data. I don't have the exact code on me at the moment, but has anyone else done anything with NOCONTENT and had a similiar problem? (and solved it?) Mark -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
multibox
I need a form that has checkboxes (multiboxes) for all the states. First I would like to know if the parameters of the multibox allow one to save the names (state name) of the checkboxes along with an indication of whether they are checked or unchecked Too, I need to save to a database and redisplay the entire set of checkboxes, both checked and unchecked. If anyone has any sample code of arrays iterators (for the java code) and what it takes to display it (JSP) -- would be very much appreciated? Thanks, George
doing arithmitic ops
Hi! I have a simple question. Will I be able to produce a mathematically calculated value based on the input given without another variable? here's the scenario. JSP page 1, I have an input textfield (num) and a submit button on my form bean, I have a variable called num. on my action form, it just forward to the JSP page 2 on JSP page 2, I want to display in HTML format the value of num multiplied by 3. will i be forced to create another variable in the form bean , say total, that will do the computation and store in that variable and display the variable total on page 2. should it be done that way? or I can simply do the multiplication without an additional variable? thanx in advance. henrik -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: taglibs and jsp:include
Try to use template. Struts template can do exactly what you want to. --- Martin Samm [EMAIL PROTECTED] wrote: this is not directly Struts but seemed the best qualified forum (it is for a struts based app however). I'm using a custom tag to decide which jsp to include (based on some request variables) - the tag then uses a JSP writer to create the jsp:include - trouble is the 'jsp:include tag is just written out and not 'interpretted', i.e. the page isn't included. How do i get the container to interpret the include? -- Martin Samm [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Buy the perfect holiday gifts at Yahoo! Shopping. http://shopping.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts 1.1 book available for order
I fully agree with Nathan , since those $70 will be further converted to Indian Rupees, i would like to read a sample chapter on-line before deciding about the book rgds amit -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
iterator tag
Hi! how can I use the iterate tag on an arraylist in my form bean to display the elements in the arraylist the bean name = BEAN the ArrayList of strings is Arr logic:iterate id=element name=BEAN property=arr bean:write name=element property=arr / /logic:iterate is this correct? thanx in advance h -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tokens
Hi, what are tokens? Do any of you have a link of a page that discusses what are tokens and what is there use? Thanks! :) __ Do You Yahoo!? Buy the perfect holiday gifts at Yahoo! Shopping. http://shopping.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tokens
see the example app - they're used to track if the form has already been submitted and such (back button and reload button issues). --- Stanley Struts [EMAIL PROTECTED] wrote: Hi, what are tokens? Do any of you have a link of a page that discusses what are tokens and what is there use? Thanks! :) __ Do You Yahoo!? Buy the perfect holiday gifts at Yahoo! Shopping. http://shopping.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Buy the perfect holiday gifts at Yahoo! Shopping. http://shopping.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]