You can :
1. write your own servlet request processor by inheritating existed one.
2. you can write a listener
3. you can write a intercepter (e.g. can be used before processing all post
requests)
4. you can write a tag handler
  (this one is light weight solution, but on suitable if visitors hacking
system by typing URL that is not your home page, which means you have to put
your tag on everypages which is not quite effecient)
5. If you have define your login page and secure all resources other then
the login page, you can process your request in the action class which
handles login_after event
(in case of using form auth, you can secure all action invocation, call an
action to trigger out the login form )

Wish it helps

On 9/20/06, starki78 <[EMAIL PROTECTED]> wrote:

THANK YOU!

Now I have in mind to make a filter, with
a static boolean,
that enjures the just the very first request
is handled.
Is this a good idea?

What is the best possbility to handle just the first request
in a web-application?

THANKS A LOT
STARKI




> you can set init parameters in your web.xml, or a helper class (a bean)
that
> will be loaded to your session when application started.
>
> On 9/20/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > I guess so...
> >
> > If you are using specific vendor products like BEA WebLogic, you can
use
> > the Startup Classes to do the job for you.
> >
> > Thanks and regards,
> > Pazhanikanthan. P (Paz)
> >
> > Consultant for AXA,
> > Senior Software Engineer,
> > HCL Australia Services Pty. Ltd.
> > Off   : +61-3-9618-4085
> > Mob : +61-0411-354-838
> >
> >
> >
> >
> > "starki78" <[EMAIL PROTECTED]>
> > 20/09/2006 06:11 PM
> > Please respond to "Struts Users Mailing List"
> >
> >         To:     "user" <user@struts.apache.org>
> >         cc:
> >         Subject:        Re: Getting the server-port from a
ContextListener
> >
> >
> > Thank you for your answer
> >
> > I'm trying to write the
> > Servername and the Port of the application
> > in the database at the earliest moment
> > possible, so what would you recommend?
> > Is the ContextListener the wrong choice?
> >
> > Nice greetings Starki
> >
> >
> > ---------- Initial Header -----------
> >
> > From      : [EMAIL PROTECTED]
> > To          : "Struts Users Mailing List"
> > user@struts.apache.org,"starki78" [EMAIL PROTECTED]
> > Cc          :
> > Date      : Wed, 20 Sep 2006 18:00:13 +1000
> > Subject : Re: Getting the server-port from a ContextListener
> >
> >
> >
> >
> >
> >
> >
> > > You might pick one of the options:
> > >
> > >
> > > 1. Have some Init Params in web.xml to store the server name and
port.
> > > Inside your contextInitialized() method, use
> > >
> > >         ServletContextEvent.getServletContext().getInitParameter()
> > >
> > > to access them.
> > >
> > > 2. User Servlet Container Vendor APIs to extract the information.
> > >
> > > Thanks and regards,
> > > Pazhanikanthan. P (Paz)
> > >
> > > Consultant for AXA,
> > > Senior Software Engineer,
> > > HCL Australia Services Pty. Ltd.
> > > Off   : +61-3-9618-4085
> > > Mob : +61-0411-354-838
> > >
> > >
> > >
> > >
> > > "starki78" <[EMAIL PROTECTED]>
> > > 20/09/2006 05:52 PM
> > > Please respond to "Struts Users Mailing List"
> > >
> > >         To:     "user" <user@struts.apache.org>
> > >         cc:
> > >         Subject:        Re: Getting the server-port from a
> > ContextListener
> > >
> > >
> > > HI!
> > >
> > > No I want to write the server name and port
> > > where the applikation is running
> > > in the
> > > Database within the ContextInitialized Event!
> > >
> > > Is this possible somehow?
> > >
> > > Nice greetings
> > >
> > >
> > > ---------- Initial Header -----------
> > >
> > > From      : "Li" [EMAIL PROTECTED]
> > > To          : "Struts Users Mailing List" user@struts.apache.org
> > > Cc          :
> > > Date      : Wed, 20 Sep 2006 15:45:40 +0800
> > > Subject : Re: Getting the server-port from a ContextListener
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > > r u trying to do some test case?
> > > >
> > > > On 9/20/06, starki78 <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > HI!
> > > > >
> > > > > I've a Servlet implementing ServletContextListener
> > > > > and in the contextInitialized I needed the server-name
> > > > > and the port of the server.
> > > > > So I needed to simulate a request.
> > > > > Is this possible somehow?
> > > > >
> > > > > Thanks for any help!
> > > > > Starki
> > > > >
> > > > >
> > > > > ------------------------------------------------------
> > > > > Tutti i libri che vuoi, li trovi su BOL. Ordini on line e paghi
alla
> > > > > consegna.
> > > > > http://click.libero.it/bol
> > > > >
> > > > >
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > When we invent time, we invent death.
> > > >
> > >
> > >
> > > ------------------------------------------------------
> > > Tutti i libri che vuoi, li trovi su BOL. Ordini on line e paghi alla
> > > consegna.
> > > http://click.libero.it/bol
> > >
> > >
> > >
> > >
---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
_____________________________________________________________________
> > > This e-mail has been scanned for viruses by MCI's Internet Managed
> > > Scanning Services - powered by MessageLabs. For further information
> > > visit http://www.mci.com
> > >
> > >
> > >
> > >
> >
> >
*********************************************************************************
> > > Important Note
> > > This email (including any attachments) contains information which is
> > > confidential and may be subject to legal privilege.  If you are not
> > > the intended recipient you must not use, distribute or copy this
> > > email.  If you have received this email in error please notify the
> > > sender immediately and delete this email. Any views expressed in
this
> > > email are not necessarily the views of AXA.   Thank you.
> > >
> >
> >
**********************************************************************************
> > >
> >
> >
> > ------------------------------------------------------
> > Tutti i libri che vuoi, li trovi su BOL. Ordini on line e paghi alla
> > consegna.
> > http://click.libero.it/bol
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > _____________________________________________________________________
> > This e-mail has been scanned for viruses by MCI's Internet Managed
> > Scanning Services - powered by MessageLabs. For further information
> > visit http://www.mci.com
> >
> >
> >
> >
> >
*********************************************************************************
> > Important Note
> > This email (including any attachments) contains information which is
> > confidential and may be subject to legal privilege.  If you are not
> > the intended recipient you must not use, distribute or copy this
> > email.  If you have received this email in error please notify the
> > sender immediately and delete this email. Any views expressed in this
> > email are not necessarily the views of AXA.   Thank you.
> >
> >
**********************************************************************************
> >
> >
>
>
> --
> When we invent time, we invent death.
>


------------------------------------------------------
Tutti i libri che vuoi, li trovi su BOL. Ordini on line e paghi alla
consegna.
http://click.libero.it/bol



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




--
When we invent time, we invent death.

Reply via email to