Tiles - Localization possible through tiles-def?

2003-10-12 Thread Sean Dockery
I am relatively new to Tiles, so forgive me if there's a simple solution to
this...

I came across the following situation:

tiles-defs.xml:









Default.jsp:
<%@ taglib uri="/struts/tiles.tld" prefix="tiles"%>









I can't think of a way to _directly_ localize on tiles:getAsString, so I was
wondering what is the recommended approach?  Of course, I could put a
 in a JSP and use  to
fetch it.  Is the use of tiles:getAsString disrecommended anywhere for
internationalized applications?  If not, should it be?

Here's an idea:  What if the put element supported a key attribute (mutually
exclusive to the value attribute) to fetch values from a resource bundle.
Comments?





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts and user-authentication

2003-10-06 Thread Sean Dockery
You can use tiles to optionally display information based on a user's role.
Another possibility is to use the Struts logic tags to test if the user is
in a given role; the body of the tag will either be rendered or
not--depending on whether or not a use is in a given role.

"Ilja" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thanks! Very helpfull, but still some questions:
>
> How can you programmaticly make use of struts-config.xml? Now the
> loginpage is hardcoded:
>
> String loginPage = request.getContextPath()+"/logon.do";
>
> Can't you make it more generic so that it uses the config-file to look it
> up?
>
> Secondly: How can you display userinformation in a jsp-page when you have
> your own authentication-system? I probably have to write my own taglibs
> right?
>
> Ilja
>
> On Mon, 6 Oct 2003 18:10:56 +0530, "Deepak" <[EMAIL PROTECTED]> said:
> > Try this :
> > http://www.theserverside.com/resources/article.jsp?l=JAAS
> >
> > - Original Message - 
> > From: "Ilja" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, October 06, 2003 6:00 PM
> > Subject: Struts and user-authentication
> >
> >
> > > Is there any good example on how to incorporate strict
> > > user-authentication with Struts?
> > >
> > > Currently I'm working on a way to implement user-authentication with
> > > OSUser (www.opensymphony.com/osuser) and hibernate (www.hibernate.org)
> > >
> > > What's the best way to implement user-security? Where should the
> > > authentication method be put in? In every action? Is it possible to
> > > create one generic class that authorizes a user and sends it to the
> > > appropiate page (either the page he requested, an error or a
login-page)
> > > without coding it on every single action page?
> > >
> > > Thanks,
> > >
> > > Ilja
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to use jaas with Struts and Tomcat

2003-10-06 Thread Sean Dockery
>From another recent thread on this subject:


Try this :
http://www.theserverside.com/resources/article.jsp?l=JAAS


"Marcial Atienzar Navarro" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
>  I need to know how to use jaas with struts in tomcat. Is there some kind
of
> example in the network? Where can I find more information about this?
>
>  A lot of thanks,
>
>   Marcial Atienzar




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Craig: Tomcat 5.0 WAR Deployment

2003-10-06 Thread Sean Dockery
I believe that you mean deploy and undeploy.  Haven't install and remove
been deprecated under Tomcat 5?  I couldn't find an example that uses the
install or remove tasks on the page you cited.  :-)

"Craig R. McClanahan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Mark Galbreath wrote:
>
> >Craig,
> >
> >I'm writing a simple Struts standalone app to Tomcat 5.0 (trying to learn
> >Struts + JDO) and Tomcat is not auto-deploying the WAR after Ant
compiles,
> >assembles, and puts it in the webapps root.  Auto-deploy is set to "true"
in
> >server.xml...anything else I am missing?
> >
> >
> I don't like the "autodeploy from the webapps" feature because you can't
> undeploy.  I tend to use the "install" and "remove" and "reload" Ant
> tasks instead:
>
>
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/manager-howto.html#Executing%20Manager%20Commands%20With%20Ant
>
> Note that you don't have to copy anything -- just tell Tomcat to deploy
> directly from your build directory (if you're on the same machine).  An
> example build.xml that supports this feature can be found at:
>
> http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/index.html
>
> >Thx,
> >Mark
> >
> >
> Craig




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Must everything go through an action?...

2003-10-05 Thread Sean Dockery
It seems to me that a tiles controller can play the role of view helper.  It
is definitely more convenient that writing custom tags.  :-)


-- 
Sean Dockery
[EMAIL PROTECTED]
Certified Java Web Component Developer
Certified Delphi Programmer
SBD Consultants
http://www.sbdconsultants.com


"Ted Husted" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> The current trend is to define two sets of Actions. One set represents
> the business actions, the client stories. This Action interacts with the
> business layer and, based on what happens, selects the next View. Back
> in the Struts 0.5 days, the ActionForward would often points to a server
> page, so the Action would, essentially, forward directly to a JSP.
>
> Most of us now find it convenient to create a second set of "View"
> Actions. These Actions work as "page controllers". Instead of forwarding
> to the JSP, we forward to these Actions instead. These Actions can then
> prepare the request with whatever "chrome" the page may need.
>
> It's a good practice to define an ActionMapping for every presentation
> page in the application, whether it's a server page or HTML, local or
> remote, even if it just forwards out to a page. If you need to add an
> Action class later, or switch in a server page for a static page, you
> can do that without changing anything else.
>
> In Strut 1.1, I find it useful to separate the business Actions and the
> view Actions into separate configuration files, and may give the View
> Actions their own virtual path. So there might be a /SelectPermitAction
> and a /view/SelectPermitAction.
>
> There is talk of adding a specific extension point for a "view Action"
> as part of the ActionForward construct, but AFAIK, no one's rolled up
> their sleeves and given it a try. This would save a trip through the
> container, and simplify cases where you want to redirect to another
> business Action.
>
> HTH, Ted.
>
> Keith Pemberton wrote:
> > Experts,
> >
> > I'm struggling with using the View Helper pattern.  In my logical
way of
> > thinking, when a request to any jsp page is made, then the request goes
to
> > the ActionServlet.  The ActionServlet then looks up the appropriate view
> > helper initiallizes it with any parameters that were passed in through
the
> > request.  The ActionServlet then requests that the view helper put the
> > required java bean object in the request scope and then the servlet
forwards
> > to the page that was requested.  This doesn't seem to be the case,
though,
> > with how struts works.  Please correct me if I am wrong, but every link
in
> > my jsp pages where the page that I am requesting has content that comes
from
> > a java bean (form bean) must be linked to some action component.  So,
just
> > say that I have an index page where I am displaying only five items at a
> > time out of database that are ranked based on their index number in the
> > database.  To get the next five entries from the database I would have
to
> > use the struts tags and put an html:link element in the page that
pointed to
> > some action class.  I, guess, am just looking for an assurance that I am
> > implementing the view helper pattern the correct way according to
struts.
> > Any help you can provide would be much appreciated!
> >
> > Keith Pemberton
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -- 
> Ted Husted,
>Junit in Action  - <http://www.manning.com/massol/>,
>Struts in Action - <http://husted.com/struts/book.html>,
>JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
>
> "Get Ready, We're Moving Out!!" - <http://www.clark04.com>




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Application Startup

2003-02-11 Thread Sean Dockery
It seems to me that the best place to make the connection in
ServletContextListener.contextCreated.  If the application is unavailable,
you can store that in the application context and when requests come in for
that resource, you can display in the response that the resource was
unavailable.

You would also be able to periodically retry establishing the connection if
you weren't able to create the connection when the application first
started.  Having the application send you (or your system administrator) an
email or pager message could also be done.

- Original Message -
From: "Heligon Sandra" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Tuesday, February 11, 2003 01:39
Subject: RE: Application Startup


> I would like to know when the ServletContextListener.contextCreated()
> function is
> called when Tomcat starts ? or is it possible to call this function only
on
> the first request?
> In fact when the first request arrives to Tomcat I have to open an
> application session on
> our application server to get business data.
> This application session is the same for all the clients.
> But the creation of this session is transparent for the clients, I cannot
> ask him to go to see in the files of Tomcat's log.
> That's why if an error occurs at the application session creation, on the
> first action
> of the client I would like to display an error. Because if the application
> session is not
> created the client can nothing make.
>
> If I understood the various remarks well, there are several ways of
making:
>
> - Place code in the ServletContextListener.contextCreated() and use Token
> objects
>   to indicate an error; But we decide to start Tomcat as Windows service
but
> not our
>   application server. So I can use this method only if this method is
called
> on the
>   first request and not on the Tomcat startup.
>
> - Override the init() method of the TilesRequestProcessor class; I try
this
> but
>   the debug doesn't enter in the overridden method;
>
> - Use Filter; I am not informed any on this subject where can I find the
> best doc about
>   filters;
>
> -Original Message-
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Sent: 06 February 2003 22:56
> To: Struts Users Mailing List
> Subject: RE: Application Startup
>
>
>
>
> On Thu, 6 Feb 2003, Heligon Sandra wrote:
>
> > Date: Thu, 6 Feb 2003 15:01:44 +0100
> > From: Heligon Sandra <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> > Subject: RE: Application Startup
> >
> > The problem with the ServletContextListener is that we can not
> > display error to the client if an error occur, isn'it ?
> >
>
> If you're doing things at application startup, there *are* no users yet.
>
> A ServletContextListener.contextCreated() method that detects an error
> should write messages to the appropriate log file to describe what
> happened (for example, you could call ServletContext.log() for this), plus
> throw an exception back to the container.  That will cause the container
> to not put the application into service, because something was wrong at
> startup time.
>
> In a Servlet 2.2 environment, you'd do exactly the same sort of thing, but
> in t he init() method of a servlet marked for  instead.
>
> In either case, the initialization will have been completed by the
> container before the application is allowed to start processing requests.
>
> Craig
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Newbie Question

2003-02-11 Thread Sean Dockery
Wouldn't that be...

!A || B


- Original Message -
From: "Gemes Tibor" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 11, 2003 01:29
Subject: Re: Newbie Question


2003. február 11. 09:07 dátummal Ray Madigan ezt írtad:
> Thanks for the advice - i didn't know this stuff existed.
>
> I was just pondering how to implement logic like
> if ! A || ( A && B )

A && !B

Tib

-
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: trouble

2003-02-10 Thread Sean Dockery
What forwards are defined for your action in struts-config.xml?


- Original Message - 
From: "alexj" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, February 10, 2003 10:56
Subject: Re:  trouble


> (in fact when I run the app and enter bad datas I didn't get any
> errors message displayed on my login page)
> 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]