RE: Validation Problem - very urgent please reply
I had the same problem, and besides setting the form to session scope you could do the following: Instead of storing your list of languages in an ArrayList, store them in an array of Strings. Then on your jsp you should be able to iterate over this list and sent all languages via the html:hidden tag (that is why you have to use Strings, because they are sent as Strings) with your request. So the languages are stored in your form with every request, and when validation fails, you still have the languages there. The iteration should look something like this: Hope that helps, perhaps you could reply when it works! Peter -Ursprüngliche Nachricht- Von: Sony Thomas [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 10. Januar 2006 10:51 An: user@struts.apache.org Betreff: Validation Problem - very urgent please reply Dear friends, I have a Add user jsp page and in my jsp page the user can select his language from a dropdown menu. I am generating it from the ArrayList property in UserForm. My problem is , when there is a validation error and control returns to the jsp page it is not able to find the languages collection, ie ArrayList. I know it is possible to solve by setting the form to session. but I dont want it to be in the session. Is there is any way out for this problem ?? Please reply to me thanks in advance Sony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Want dynamic menus
Where to find the struts menu tutorial? Peter -Ursprüngliche Nachricht- Von: news [mailto:[EMAIL PROTECTED] Auftrag von Danny Lee Gesendet: Dienstag, 13. Dezember 2005 10:45 An: user@struts.apache.org Betreff: Re: Want dynamic menus Struts menu is just fine, works with latest stuff and can be attached to DB too, there is a nice tutorial. If the stuff works just fine, why do you need updates? :) Cheers, Danny Antony Paul schrieb: > Hi all, > I am looking for a component to create menus in Java web applications. I > want to have a drop down menu with many levels and a tree menu with > expand/collapse. It should be configurable to work in client > side/serverside. It should work with Struts/Spring and should be Apache or > compatible licence. What are the suggestions ?. On googling I found Struts > Menu, Struts Layout, Jenkov Prizetags. I found Struts Menu to be good one > but it seems that it is not actively developed now. The last release was in > Sep 2004. The MyFaces > Tomahawk tree control is excellent but it requires JSF. > > -- > rgds > Antony Paul > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Action forward path
Could you post your complete action mapping and your corresponding Action (or only the important parts?) Peter - [EMAIL PROTECTED] napisał(a): > In that case, when action mapping looks like this > (as you wrote in your mail before): > >input="/path/file.jsp" ...> > > > > then you have to do the following at the end of your > action (after all work has been done): > > return mapping.findForward( "ok" ); I do this, but struts still forwarding me to "http://localhost/context/MyAction.do"; - not "http://localhost/context/path/MyAction.do";. And I have defined: and in my struts action I return mapping.findForward("ok"). What I do wrong? Regards -- Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Action forward path
In that case, when action mapping looks like this (as you wrote in your mail before): then you have to do the following at the end of your action (after all work has been done): return mapping.findForward( "ok" ); where the "ok" has to be the same in the method and in forward name parameter. Struts searches the forwards taht you define in your mapping, and returns an ActionForward (you dont need to care about this, it is all done for you). If you would like your action to forward to another place (that can be another jsp, or Action, for example if an error occurs), you would do the following: and in your action if( no errors ) return mapping.findForward( "ok" ); else return mapping.findForward( "notok" ); Greetings Peter - -Ursprüngliche Nachricht- Von: Andrzej Bengner [mailto:[EMAIL PROTECTED] Gesendet: Montag, 12. Dezember 2005 10:37 An: Struts Users Mailing List Betreff: Re: Action forward path > The parameter attribute defines the target of your > forward action, that is your jsp. Thanks. And what if I want to execute my action (do something) and forward to this path (/path/file.jsp or /path/MyAction.do)? Regards -- Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Action forward path
Hi! If you only want your Action to forward to the jsp, and do nothing else, use a ForwardAction like this: The parameter attribute defines the target of your forward action, that is your jsp. Greetings Peter - Hello, I have one problem with forwarding my action. In my action mapping is: and when I execute my action, then forwarding me to localhost:8080/context/MyAction.do - not localhost:8080/context/path/file.jsp (or localhost:8080/context/path/MyAction.do) How can I dissolve this? Regards -- Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot find ActionMappings or ActionFormBeans collection
-Ursprüngliche Nachricht- I think in your jsp has to be if you have told your web.xml to map all *.do requests to struts like this YourAppName org.apache.struts.action.ActionServlet config /WEB-INF/struts-config.xml 1 YourAppName *.do Hope that helps Peter Von: Mariano Garcia [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 15. November 2005 12:15 An: user@struts.apache.org Betreff: Cannot find ActionMappings or ActionFormBeans collection Hi guys, I have searched some posts about this subject, but not a valid solution was provided. I get an error and I don't know how to solve it, and I have not found a solution searching the web. The error is the following: javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI mpl.java:825) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:758) [...] My application is very easy, so it must be a typo or some error in my config files. This is the code: *** jsp page *** [...] [...] *** struts-config.xml *** Any help? Thanks a lot, -- Mariano García González :: Analista Programador --- Entel IT Consulting, SA Tlf.91 567 07 36 Mobile. 619 08 70 90 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problems setting the input forward validating forms
Hi all! I have got the following problem: an external script submits a request to my web-app ans is not interested what happens with it. As set in the struts-config.xml, the request parameters are used to populate a DynaValidatorForm, which is validated as specified in my validation.xml. If validation fails, the form should be forwarded to another action which logs the data in the form so that errors can be traced. So I did the following: So if validation is ok, the NewActivityTriggerAction adds the data to my database, but if it fails, the TriggerErrorAction should perform its work. But nothing happens! There is no error in my logs, whether in my standard log nor in my special trigger error log. The form is populated properly, and if I turn of validation, everything works fine (my NewActivityTriggerAction throws an Exception as expected). So why does the input forward not work? Does anyone have a suggestion? Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: a simpler way?
I understand what you mean, but my example has been very simple and only a little part of my page. I have much more text fields on my page, and everything I need is stored in a Bean in session scope. So using a PreAction to copy my whole Bean to an ActionForm with a lot of properties would be a lot of work and code. DynaValidatorFroms and Beans are there to avoid this extra Action, and all this extra properties, or is it wrong? As you can see, I still have to learn a lot... Regards, Peter >By overriding the value in each text field you will never get the user enter value after validation >fails. > >You should (at least how i understand), populate the action form with values in a "PreAction" >i.e. > >PreAction -> display to user -> PostAction > >The preaction takes in the action form and populates its default values. Then you can using the >struts "html" tag as they are intended > >Regards, > >Gareth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
a simpler way?
Hi all! Lets say I have a form with two text fields on a jsp page: Both text fields are validated (I use a DynaValidatorForm) and a text is required for both. If the user changes both text fields (lets say deletes project and changes version), validation fails and the user is send back to the text fields. But now the text in the field "version" shows again the ${beanFromSessionScope.version} value, and not the one previously changed by the user. A workaround: Is there a simpler way to achieve this? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Prepopulating DynaValidatorForm and validating
Hi all! Googling and seraching the archive did not solve my problem, so I will have a try. In my struts-config.xml, I have defined a DynaValidatorForm and an action: ... As you can see, this form holds a list of projects in a collection, which has to be populated before the corresponding jsp-page is shown. So I have an Action which gets the (dynamic, not static) list of projects from a database and puts it into the editForm like this: public ActionForward execute( ... ) { DynaValidatorForm dynaForm = (DynaValidatorForm) form; // get list of projects from database Collection projectList = getDatabaseHandler().getProjectList(); // put project list into DynaValidatorForm dynaForm.set( "projectList", projectList ); Everything works fine after showing my jsp-page with a combobox populated with the data from my projectList - the user can choose one project. But on the same page there is a html:text field: which corresponds to my editForms "version"-property. When the user submits the form to processEdit, the version property has to be validated to see if it is not empty. So in my validation.xml I do the following: If the user submits an empty version and validation fails, he will be send back to the jsp-page, but it will not show because the project list is not present any more. That seems clear because the DynaValidatorForm is reset when the user submits. I tried following workarounds: 1. I replaced the DynaValidatorForm with my own version overwriting the reset - method to do nothing. Additionaly set the scope to "session". But my project list gets still lost (wondering why?) 2. Trying to pass my project list from one form to the other like this
logic:lessThan problem
Hi list! I have some problems comparing values with logic tags. I have searched the mailing list archive, but I only found solutions that look pretty the same as what I have done, but it still does not work. So perhaps someone can help. I have a bean which stores a list of projects. Because the size of this list can vary, I get it like this: When I write out the size bean , the correct size is shown. But when I try to do the following: Less than 5! Greater or equal 5! always both messages are shown! Is there something I am missing? Thanks, Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tiles showing directory listing inside WEB-INF
Hi all! I got confused when I experimented with tiles to learn how it works. Here is what I have done. I have created a DeafultLayout.jsp: <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %> TilesTest So there are three regions, which I populate in a tiles definition like this: When I use this definition in an jsp like this: my web-app shows the directory listing of WEB-INF/jsp/layout (besides the header and footer). So the line seems to be the problem. Is it ok for my web-app to show directory listings inside my WEB-INF folder? How can I prevent Tomcat to do so, if i forget to put a tile into my layout? More basically: Why does Tomcat list my directory when a tile is put with value=""? Or is it a problem of tiles? There is another problem, too. My stylesheets are ignored. If I use navigation.jsp for the navigation tile, everything is fine. Why aren't the stylesheets used in case of value=""? You see, I only scratch the surface of tiles and need some more in-depth covering of it. Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems configuring Tiles
Turning validation off and changing tiles-config.dtd into tiles-config_1_1.dtd like suggested by Laurie Harper did not work. So I removed the DOCTYPE declaration and it seems to work. I wonder why the xml parser tries to connect to http://jakarta.apache.org/ for my tiles-defs.xml, I always thought it is only a describing name rather than a real URL to connect to. I also use the following declaration in my struts-config-xml, and there have not been any problems. http://struts.apache.org/dtds/struts-config_1_2.dtd";> Has anyone a suggestion? Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems configuring Tiles
Hi all! I would like my web-app (using Struts 1.2.7, Tomcat 5.5.9, Windows 2000) to use Tiles, and so I updated my struts-config.xml with a tiles plugin In my WEB-INF folder there is the following tiles-defs.xml: http://jakarta.apache.org/struts/dtds/tiles-config.dtd";> (with an empty definition for now) On deploying my web-app to Tomcat I get the following exception(s): (see attachment for full stacktrace) javax.servlet.ServletException: IO Error while parsing file '/WEB-INF/tiles-defs.xml'. Connection refused: connect What is going wrong here? There is tiles-config_1_1.dtd in my WEB-INF folder, too? Is there something I am missing? Peter <> 13:10:25,396 - TilesPlugin - ERROR [http-80-Processor25] Can't create Tiles definition factory for module ''. 13:10:25,406 - ActionServlet - ERROR [http-80-Processor25] Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency. javax.servlet.ServletException: IO Error while parsing file '/WEB-INF/tiles-defs.xml'. Connection refused: connect at org.apache.struts.tiles.TilesPlugin.initDefinitionsFactory(TilesPlugin.java:233) at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:137) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336) at javax.servlet.GenericServlet.init(GenericServlet.java:211) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1091) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:925) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3857) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4118) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:788) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503) at mx4j.server.interceptor.InvokerMBeanServerInterceptor.invoke(InvokerMBeanServerInterceptor.java:221) at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:120) at mx4j.server.interceptor.SecurityMBeanServerInterceptor.invoke(SecurityMBeanServerInterceptor.java:84) at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:120) at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:120) at mx4j.server.interceptor.ContextClassLoaderMBeanServerInterceptor.invoke(ContextClassLoaderMBeanServerInterceptor.java:203) at mx4j.server.MX4JMBeanServer.invoke(MX4JMBeanServer.java:1043) at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1377) at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:636) at org.apache.catalina.manager.ManagerServlet.doPut(ManagerServlet.java:423) at javax.servlet.http.HttpServlet.service(HttpServlet.java:712) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http1
Loading properties
Hi! I would like my web-app to read in a *.properties file at startup (not for i18n, but the good old java.util.Properties, for example to get the e-mail address of the admin of the web-app). So I wrote a ServletContextListener which will load the properties-file and store it into servlet context from where it can be accessed throughout my web-app. But where I do have to put the myProps.properties file? I tried WEB-INF/classes, but I get a FileNotFoundException. Or do I have to configure web.xml or struts-config.xml in some way? Or is there a better way to store the required data (such as admin's e-mail)? Thanks Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Showing stacktrace in jsp
Hi! I wolud like to do the following: If an Action catches an Exception, I would like to forward to an error page that shwos some general message, such as "There has been an error accessing tha database." But I would like to provide a link or something else (which is shown to for example all admins), so that the user can watch the whole stacktrace of the exception. You could store the original Exception in request-scope, but is there a simple way/ a tag to print out the whole stacktrace of my exception in the jsp? Or do I have to do it on my own? Thanks, Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Forwarding in custom RequestProcessor
Hi! I have extended the RequestProcessor's processPreprocess() method in order to perform a simple user authentication mechanism using cookies. If a cookie identifying a user is found, but the users member- ship has expired, I would like him to be forwarded/redirected to a corresponding error page. What is the best way to do this? I tried the following: request.getRequestDispatcher( "membershipExpired.jsp" ).forward( request, response ); which works fine. But this is surely not how struts should work because I have hardcoded the target in my code, and not configured in my struts-config.xml for example. So if the error page changes I have to chnage my code and not only the struts-config.xml. Does anybody know a better solution? I tried a global-forward like this but it didn't work: with request.getRequestDispatcher( "nodb" ).forward( request, response ); Perhaps I made a mistake somewhere... Peter -- MATERNA GmbH Information & Communications Vosskuhle 37 44141 Dortmund Tel: +49-231-5599-8868 Fax: +49-231-5599-678868 [EMAIL PROTECTED] www.annyway.dewww.materna.de www.annyway.com www.materna.com Visit us at the following events: ACI EUROPE, Munich June, 22 - 24, 2005 ACI EUROPE, Verona September, 26 - 28, 2005 CTIA Wireless I.T. & Entertainment 2005, San Francisco September, 27 - 29, 2005 Con4, Cologne September, 27 - 29, 2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Tomcat5.exe Holds Onto Struts.jar
Are you using Windows? Than this it no tomcat specific problem. yout struts.jar is not deleted because windows locks this file. i had the same problem. the solution is to add the directory META-INF to your project. put a file named context.xml into it with the following lines: when the attribute antiResourceLocking is set to true tomcat does not use this one but works with an internal copy of it so that windows does not lock it. then everything works fine... Peter -Ursprüngliche Nachricht- Von: Robert Nicholls [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 7. Juli 2005 15:48 An: user@struts.apache.org Betreff: Tomcat5.exe Holds Onto Struts.jar Hi: Perhaps this is a Tomcat question but it applies only to Struts. I have Tomcat 5.5 running under Windows 2000 with Eclipse as the IDE. Ant is used to assemble, compile and deploy the applications. However, the process Tomcat5.exe accesses the struts.jar at /WEB-INF/lib/struts.jar. The result is that when we run Ant and try to undeploy the application all files but the struts.jar are removed and the deployment process fails. Although Tomcat has access to all the jars in the various libs (common, shared and server) it only has access to the struts jars in the application libs. We use Process Explorer to verify this. There seem to be several threads reporting similar behavior. Our present solution is to operate with unpacked wars (it works) but we would like to improve the performance with unpacked wars. Any thoughts? Regards, Bob Nicholls MIT Lincoln Laboratory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Newbie: Where to put instance for database access?
>Should it be stored in the ServletContext for application scope? But >how do I access this instance from my Actions? >getServlet().getServletContext().getAttribute(xxx) is it the same as request.getSession().getServletContext().getAttribute(xxx) ? Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie: Where to put instance for database access?
Hi! I have maybe a simple question: My web-app has to get data out of a database. I have a class DatabaseHandler which holds a connection to the database and provides methods to query it. I would like to have only one instance of this class in my web-app. But I don't know where to put it. Should it be stored in the ServletContext for application scope? But how do I access this instance from my Actions? Or would it be better to use data-sources? If I should use them, does anybody know a good tutorial on the internet? Perhaps hibernate would be a good choice too, but I think its a bit oversized for my application. You see - I am a total newbie concerning the use of databases with struts. Please help!!! Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: log4j log
Its the filename, but where is it stored on your harddisk? With Win2003 and Tomcat I found my log-file in C:\WINNT\SYSTEM32! Peter -Ursprüngliche Nachricht- Von: Vijay K Anand [mailto:[EMAIL PROTECTED] Gesendet: Montag, 4. Juli 2005 14:58 An: Struts Users Mailing List Betreff: Re: log4j log Hi This is the file name i have specified below --> npi_log Vijay K Anand wrote: > Hi > Here goes my log4j property file > > log4j.rootLogger=ERROR, A2 > log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender > log4j.appender.A2.Threshold=DEBUG > log4j.appender.A2.file=npi_log > log4j.appender.A2.append=true > log4j.appender.A2.layout=org.apache.log4j.PatternLayout > log4j.appender.A2.layout.ConversionPattern=%d [%t] %-5p %c - %m%n > > here is the code where i want to log > > static Logger logger = > Logger.getLogger(HighLevelAction.class.getClass()); > > logger.debug("test"); > > th eproblem is : it is not logging anything > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
logic:forward and session
Hello all! I still have a problem that struts creates a session although it should not do so. I have isolated the problem and there are only two possible locations left. One of them is this: I have an index.jsp specified in my welcome.file-list in web.xml. This index.jsp does the following: <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <%@ taglib uri="/WEB-INF/taglibs-log.tld" prefix="log" %> <%@ page session="false" %> As expected ${pageContext.session.id} returns an empty string in my log because the page-directive tells session="false" But right after the logic:forward a session is created! Is it possible that the logic:forward is bound to creation of a session? Is there a way to eliminate this behaviour? I found nothing on the WWW so I will try here. Thanks Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Struts and Sessions Problem
No, there is no filter or something else, only the things I included in my first mail (besides the login.jsp and home.jsp to which the success and failure forwards point to) Peter -Ursprüngliche Nachricht- Von: Ed Griebel [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 29. Juni 2005 18:53 An: Struts Users Mailing List Betreff: Re: Struts and Sessions Problem Is it possible that you have a servlet filter set up which creates a session? Possibly one that checks if the user is logged in? -ed On 6/29/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello again > > As Michael suggested I put a session="false" in the page directive in my > index.jsp like this > > <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> > <%@ page session="false" %> > > > > > > > but the problem still is there. my session is not null! > > Peter > -Ursprüngliche Nachricht- > Von: Michael Jouravlev [mailto:[EMAIL PROTECTED] > Gesendet: Mittwoch, 29. Juni 2005 18:16 > An: Struts Users Mailing List > Betreff: Re: Struts and Sessions Problem > > > Hmm, I don't see how the session can be null. If you start from JSP, > and you did not set session="false" in the page directive, then to my > understanding, session should be created right in the JSP. > > Michael. > > > My index.jsp only forwards like this: > > > > <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> > > > > > > > > > > > > [skipped] > > > My problem: when a user accesses my webapp for the first time this method > > does not return null, > > although it should do so! It is no problem of Tomcat 5.5.9 I am using, the > > Servlet I wrote for testing does > > its work properly and returns null if the user accesses my page for the > > first time. So why does Struts behave > > like this? Is it because of all the forwarding and redirecting, although > it > > should have no effect in my opinion? > > > > Perhaps someone knows whats going wrong > > > > Peter > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Struts and Sessions Problem
Hello again As Michael suggested I put a session="false" in the page directive in my index.jsp like this <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <%@ page session="false" %> but the problem still is there. my session is not null! Peter -Ursprüngliche Nachricht- Von: Michael Jouravlev [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 29. Juni 2005 18:16 An: Struts Users Mailing List Betreff: Re: Struts and Sessions Problem Hmm, I don't see how the session can be null. If you start from JSP, and you did not set session="false" in the page directive, then to my understanding, session should be created right in the JSP. Michael. > My index.jsp only forwards like this: > > <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> > > > > > [skipped] > My problem: when a user accesses my webapp for the first time this method > does not return null, > although it should do so! It is no problem of Tomcat 5.5.9 I am using, the > Servlet I wrote for testing does > its work properly and returns null if the user accesses my page for the > first time. So why does Struts behave > like this? Is it because of all the forwarding and redirecting, although it > should have no effect in my opinion? > > Perhaps someone knows whats going wrong > > Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts and Sessions Problem
Hello all! I have a problem with struts and sessions, perhaps someone has an idea: My web.xml contains the following welcome file list: index.jsp My index.jsp only forwards like this: <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> My struts-config uses a global forward to map it like this: In the struts-config the final mapping to the action is this one: In CheckCookiesAction which extends Action, in the execute(...) method I get the HTTPSession like this: HttpSession session = request.getSession( false ) ); My problem: when a user accesses my webapp for the first time this method does not return null, although it should do so! It is no problem of Tomcat 5.5.9 I am using, the Servlet I wrote for testing does its work properly and returns null if the user accesses my page for the first time. So why does Struts behave like this? Is it because of all the forwarding and redirecting, although it should have no effect in my opinion? Perhaps someone knows whats going wrong Peter -- MATERNA GmbH Information & Communications Vosskuhle 37 44141 Dortmund Tel: +49-231-5599-8868 Fax: +49-231-5599-678868 [EMAIL PROTECTED] www.annyway.dewww.materna.de www.annyway.com www.materna.com Visit us at the following events: ACI EUROPE, Munich June, 22 - 24, 2005 ACI EUROPE, Verona September, 26 - 28, 2005 CTIA Wireless I.T. & Entertainment 2005, San Francisco September, 27 - 29, 2005 Con4, Cologne September, 27 - 29, 2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Extending ForwardAction
Hi all! Here a question from a newbie: Is it possible to extend the ForwardAction class to add some functionality chained to the forward? My struts-config entry would look like this: Does Struts recognize that MyForwardAction extends ForwardAction so that is uses the parameter-attribute? Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]