There has just been a discussion of adding an additional parameter to
logic:present to tell it how to cope with empty Strings. Right now, it
expects empty Strings to be represented as null. 

See <
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg01451.html
>, et seq., for more. 

The ProcessSession idea is interesting, but any discussion of this
should be moved to Struts-Dev.


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/

Andreas Prohaska wrote:
> 
> Hi,
> 
> during the development of one project using Struts I experienced some
> problems with the logic:equals tag. What I want to do is to compare a string
> in an ActionForm to the empty string. As far as I understand it, I would
> have to use two nested tags like
> 
>         <logic:present name="formBean" property="prop">
>                 <logic:equal name="formBean" property="prop" value="">
>                         ... code fails here
>                 </logic:equal>
>         </logic:present>
> 
> It seems as if the servlet API tries to convert the empty string to some
> datatype but this obviously fails (or better is not possible) and so the
> null value is still assigned to the value attribute in the CompareTagBase
> class. And this class throws a NullPointerException when the condition()
> method tries to convert the value into different types (line 180).
> 
> Has anyone already thought of a <logic:isEmpty> tag that looks if a value is
> null or empty?
> Is there are public need for this tag?
> 
> The other problem seems more serious! If the user waits for a long time, the
> session gets timed-out. When the new request arrives, a new session will be
> created and, in my case, an ActionForm instance will be put into the session
> context (since I was in the middle of filling out a form). Now everything
> looks fine to the application, but it is not since the ActionForm did not
> contain the values I have entered but the default ones :-(
> 
> There is no hook into the session management (as I have seen). The first
> method that accesses and implicitly creates the session is processLocale()
> in the ActionServlet.
> 
> Shouldn't we introduce a method like processSession() at the very beginning
> of the process() method to provide a possibility to intercept session
> deprecation and creation. In my case it would be sufficient to redirect to
> user to a special "your session has expired" page.
> 
> Any comments are welcome!
> 
>         Andreas
> 
> ------------------------------------------------------------------------
> Andreas Prohaska                          Mail: [EMAIL PROTECTED]
> Apeiron GmbH                              Tel : +49 (089) 278257-40
> Hohenzollernstr. 81                       Fax : +49 (089) 278257-49
> 80796 Muenchen
> ------------------------------------------------------------------------

Reply via email to