You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Derrick Koes <De...@skillsoft.com> on 2005/02/01 23:55:07 UTC

Formatting a date with a different time zone.

Can someone point me to the struts tag to use to format a date with a different time zone than the system default (i.e. Calendar.getInstance(TimeZone) vs. Calendar.getInstance())?

Thanks,
Derrick

Re: TilesController perform() depreciated and required in v1.2????

Posted by Corey Probst <cp...@gmail.com>.
On Tue, 1 Feb 2005 19:53:52 -0600, Jason Long
<su...@sbcglobal.net> wrote:
> Thank you for your reply.  This tip let me remove the perform method from my
> base class, but this is actually equivalent to what I was doing.  The method
> perorm() is simply implemented exactly the way I had done it.  Why would a
> method be both depreciated and required?

Well, what I get from the javadocs is that, by doing it this way you
won't be affected when the perform method is actually removed.  The
ControllerSupport class will only have the execute method in future
releases.  This leaves your implementation un-broken in future
releases and leaves those that use the old way backwards compatible
today.  Can anyone confirm this?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: TilesController perform() depreciated and required in v1.2????

Posted by Jason Long <su...@sbcglobal.net>.
Thank you for your reply.  This tip let me remove the perform method from my
base class, but this is actually equivalent to what I was doing.  The method
perorm() is simply implemented exactly the way I had done it.  Why would a
method be both depreciated and required?

Thank you for your time,

Jason Long 
CEO and Chief Software Engineer Supernova Software 
BS Physics, MS Chemical Engineering
http://www.supernovasoftware.com

-----Original Message-----
From: Corey Probst [mailto:cprbst@gmail.com] 
Sent: Tuesday, February 01, 2005 7:34 PM
To: Struts Users Mailing List; jason@supernovasoftware.com
Subject: Re: TilesController perform() depreciated and required in v1.2????

> I would appreciate any help with the following problem.  I just upgraded
one
> of my applications from v1.1 to v1.2.4.  I have resolved all upgrade
issues
> except the following.  The Controller interface has depreciated the
> perform() in favor of the execute(), but I am forced to implement both in
> order to compile the code.  Since I am implementing perform() I get many
> depreciation warnings from the compiler.  Does anyone have a solution?  I
> have provided a code sample and error message below.

You can extend the ControllerSupport concrete class and override the
execute() method instead.  That seems to work but I'd like to hear it
from somebody who knows for sure.  The javadocs *seems* to indicate
that is the intent...

http://struts.apache.org/api/org/apache/struts/tiles/ControllerSupport.html

Corey

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: TilesController perform() depreciated and required in v1.2????

Posted by Corey Probst <cp...@gmail.com>.
> I would appreciate any help with the following problem.  I just upgraded one
> of my applications from v1.1 to v1.2.4.  I have resolved all upgrade issues
> except the following.  The Controller interface has depreciated the
> perform() in favor of the execute(), but I am forced to implement both in
> order to compile the code.  Since I am implementing perform() I get many
> depreciation warnings from the compiler.  Does anyone have a solution?  I
> have provided a code sample and error message below.

You can extend the ControllerSupport concrete class and override the
execute() method instead.  That seems to work but I'd like to hear it
from somebody who knows for sure.  The javadocs *seems* to indicate
that is the intent...

http://struts.apache.org/api/org/apache/struts/tiles/ControllerSupport.html

Corey

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


TilesController perform() depreciated and required in v1.2????

Posted by Jason Long <su...@sbcglobal.net>.
I would appreciate any help with the following problem.  I just upgraded one
of my applications from v1.1 to v1.2.4.  I have resolved all upgrade issues
except the following.  The Controller interface has depreciated the
perform() in favor of the execute(), but I am forced to implement both in
order to compile the code.  Since I am implementing perform() I get many
depreciation warnings from the compiler.  Does anyone have a solution?  I
have provided a code sample and error message below.

Thank you for your time,

Jason Long - CEO and Chief Software Engineer
Supernova Software - supernovasoftware.com
BS Physics, MS Chemical Engineering


************************************************************************

Code Sample:

public abstract class BaseTilesController implements Controller {

public abstract void execute(ComponentContext context,
                             HttpServletRequest request,
                             HttpServletResponse response,
                             ServletContext servletContext) 
                    throws ServletException, Exception;

 public void perform(ComponentContext tileContext, 
                     HttpServletRequest request,
                     HttpServletResponse response,
                     ServletContext servletContext)
             throws ServletException, IOException {
  try {
    execute(tileContext, request, response, servletContext);
  } catch (Exception e) {
    e.printStackTrace();
  }
 }
}

**************************************************************************

Warning:

warning: [deprecation] perform(org.apache.struts.tile
s.ComponentContext,javax.servlet.http.HttpServletRequest,javax.servlet.http.
HttpServletResponse,javax.servlet.ServletContext) in
org.apache.struts.tiles.Controller has been deprecated

**************************************************************************



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Formatting a date with a different time zone.

Posted by Joe Germuska <Jo...@Germuska.com>.
At 5:55 PM -0500 2/1/05, Derrick Koes wrote:
>Can someone point me to the struts tag to use to format a date with 
>a different time zone than the system default (i.e. 
>Calendar.getInstance(TimeZone) vs. Calendar.getInstance())?

I would probably recommend using the JSTL formatDate tag instead of 
any Struts tag:

http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fmt/formatDate.html

You could probably also use bean:write with the "format" (or 
"formatKey") attribute:
http://struts.apache.org/userGuide/struts-bean.html#write  You would 
specify the "format" as if you were using java.text.MessageFormat 
with your bean as the single replacement argument to the format 
string.

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org