You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Paul Phillips <pa...@partitura.com> on 2002/04/07 18:48:48 UTC

alias

I need some generic advice...  probably really easy.

I have written an application with a controller servlet.  The controller 
servlet is event driven - every form submit button on one of the jsp pages 
maps to
"controller?event=DOWHATEVER".  After the controller does its thing, it 
sends the puts the results in a session, and transfers control back to a 
jsp page for display.  My first attempt at MVC.

My initial page is generated when the user types

URL/whatever/controller?event=WELCOME

Now I would like to make an alias that is like:

"URL/whatever/login" which will map to 
"URL/whatever/controller?event=WELCOME".

What is the best way to do that?

Not being much of an expert at the web.xml file, I tried the following 
within web.xml:

<servlet-mapping>
  <servlet-name>controller</servlet-name>
  <url-pattern>/controller</url-pattern>
</servlet-mapping>

<servlet-mapping>
  <servlet-name>controller?event=WELCOME</servlet-name>
  <url-pattern>/login</url-pattern>
</servlet-mapping>

That, most assuredly, did not work.

How should I go about doing this?

I guess I could change the code of my servlet so that if there is no event 
definition provided, it goes to the welcome page...  But it seems that 
there should be some way to setup an alias like this.

Thanks
Paul Phillips

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: alias

Posted by Jay Gardner <gj...@qwest.net>.
Or

<servlet>
    <servlet-name>controller_welcome</servlet-name>
    <servlet-class>controller</servlet-class>
    <init-param>
        <param-name>
            event
        </param-name>
        <param-value>
            WELCOME
        </param-value>
    </init-param>
 </servlet>

<servlet-mapping>
    <servlet-name>controller_welcome</servlet-name>
    <url-pattern>/logon</url-pattern>
</servlet-mapping>



-----Original Message-----
From: Jay Gardner [mailto:gjk@qwest.net]
Sent: Monday, April 08, 2002 1:43 AM
To: Tomcat Users List
Subject: RE: alias

I think this is what you are after??

<servlet>
    <servlet-name>controller_welcome</servlet-name>
    <servlet-class>controller</servlet-class>
    <init-param>
        <param-name>
            event
        </param-name>
        <param-value>
            WELCOME
        </param-value>
    </init-param>
 </servlet>

<servlet-mapping>
    <servlet-name>controller_welcome</servlet-name>
    <url-pattern>/url/whatever/controller?event=WELCOME</url-pattern>
</servlet-mapping>

--Jay Gardner

-----Original Message-----
From: Paul Phillips [mailto:paul@partitura.com]
Sent: Sunday, April 07, 2002 4:38 PM
To: Tomcat Users List
Subject: RE: alias

Actually, its a bit more complicated, so I don't think Jay's solution
(quoted below) will work.

I am using a security constraint with form based authentication.

This means that I have to request a servlet that is in a constrained area.
The container forwards the request to a login page outside of the
constrained area.  Once the login is processed, it goes back to the
originally requested page.

So, I have to actually have the query string passed in during the initial
login.  That is what I am trying to replace with an alias.

Paul Phillips

--On Sunday, April 7, 2002 12:09 PM -0600 Jay Gardner <gj...@qwest.net> wrote:

> Did you try
>
> <servlet>
>       <servlet-name>controller</servlet-name>
>       <servlet-class>controller</servlet-class>
>       <!--This servlet-class needs to be the actual name of the servlet.
If
> name is com.mycompany.myproject.Controller, then that is what needs to
> appear here.-->
> </servlet>
> <servlet-mapping>
>        <servlet-name>controller</servlet-name>
>       <url-pattern>/login</url-pattern>
> </servlet-mapping>
>
> Don't worry about the query string being passed in to the servlet. That
> will be passed by the container from the jsp to the servlet.
>
> Hope this helps!
>
> --Jay Gardner
>
>
> -----Original Message-----
> From: Paul Phillips [mailto:paul@partitura.com]
> Sent: Sunday, April 07, 2002 10:49 AM
> To: Tomcat Users List
> Subject: alias
>
> I need some generic advice...  probably really easy.
>
> I have written an application with a controller servlet.  The controller
> servlet is event driven - every form submit button on one of the jsp pages
> maps to
> "controller?event=DOWHATEVER".  After the controller does its thing, it
> sends the puts the results in a session, and transfers control back to a
> jsp page for display.  My first attempt at MVC.
>
> My initial page is generated when the user types
>
> URL/whatever/controller?event=WELCOME
>
> Now I would like to make an alias that is like:
>
> "URL/whatever/login" which will map to
> "URL/whatever/controller?event=WELCOME".
>
> What is the best way to do that?
>
> Not being much of an expert at the web.xml file, I tried the following
> within web.xml:
>
> <servlet-mapping>
>   <servlet-name>controller</servlet-name>
>   <url-pattern>/controller</url-pattern>
> </servlet-mapping>
>
> <servlet-mapping>
>   <servlet-name>controller?event=WELCOME</servlet-name>
>   <url-pattern>/login</url-pattern>
> </servlet-mapping>
>
> That, most assuredly, did not work.
>
> How should I go about doing this?
>
> I guess I could change the code of my servlet so that if there is no event
> definition provided, it goes to the welcome page...  But it seems that
> there should be some way to setup an alias like this.
>
> Thanks
> Paul Phillips
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>



___________________________________________________
Paul Phillips
Director of Orchestral Activities, Meadows School of the Arts
Southern Methodist University

"You must sing every note you play, sing even through the rests!"
Arturo Toscanini

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: alias

Posted by Jay Gardner <gj...@qwest.net>.
I think this is what you are after??

<servlet>
    <servlet-name>controller_welcome</servlet-name>
    <servlet-class>controller</servlet-class>
    <init-param>
        <param-name>
            event
        </param-name>
        <param-value>
            WELCOME
        </param-value>
    </init-param>
 </servlet>

<servlet-mapping>
    <servlet-name>controller_welcome</servlet-name>
    <url-pattern>/url/whatever/controller?event=WELCOME</url-pattern>
</servlet-mapping>

--Jay Gardner

-----Original Message-----
From: Paul Phillips [mailto:paul@partitura.com]
Sent: Sunday, April 07, 2002 4:38 PM
To: Tomcat Users List
Subject: RE: alias

Actually, its a bit more complicated, so I don't think Jay's solution
(quoted below) will work.

I am using a security constraint with form based authentication.

This means that I have to request a servlet that is in a constrained area.
The container forwards the request to a login page outside of the
constrained area.  Once the login is processed, it goes back to the
originally requested page.

So, I have to actually have the query string passed in during the initial
login.  That is what I am trying to replace with an alias.

Paul Phillips

--On Sunday, April 7, 2002 12:09 PM -0600 Jay Gardner <gj...@qwest.net> wrote:

> Did you try
>
> <servlet>
>       <servlet-name>controller</servlet-name>
>       <servlet-class>controller</servlet-class>
>       <!--This servlet-class needs to be the actual name of the servlet.
If
> name is com.mycompany.myproject.Controller, then that is what needs to
> appear here.-->
> </servlet>
> <servlet-mapping>
>        <servlet-name>controller</servlet-name>
>       <url-pattern>/login</url-pattern>
> </servlet-mapping>
>
> Don't worry about the query string being passed in to the servlet. That
> will be passed by the container from the jsp to the servlet.
>
> Hope this helps!
>
> --Jay Gardner
>
>
> -----Original Message-----
> From: Paul Phillips [mailto:paul@partitura.com]
> Sent: Sunday, April 07, 2002 10:49 AM
> To: Tomcat Users List
> Subject: alias
>
> I need some generic advice...  probably really easy.
>
> I have written an application with a controller servlet.  The controller
> servlet is event driven - every form submit button on one of the jsp pages
> maps to
> "controller?event=DOWHATEVER".  After the controller does its thing, it
> sends the puts the results in a session, and transfers control back to a
> jsp page for display.  My first attempt at MVC.
>
> My initial page is generated when the user types
>
> URL/whatever/controller?event=WELCOME
>
> Now I would like to make an alias that is like:
>
> "URL/whatever/login" which will map to
> "URL/whatever/controller?event=WELCOME".
>
> What is the best way to do that?
>
> Not being much of an expert at the web.xml file, I tried the following
> within web.xml:
>
> <servlet-mapping>
>   <servlet-name>controller</servlet-name>
>   <url-pattern>/controller</url-pattern>
> </servlet-mapping>
>
> <servlet-mapping>
>   <servlet-name>controller?event=WELCOME</servlet-name>
>   <url-pattern>/login</url-pattern>
> </servlet-mapping>
>
> That, most assuredly, did not work.
>
> How should I go about doing this?
>
> I guess I could change the code of my servlet so that if there is no event
> definition provided, it goes to the welcome page...  But it seems that
> there should be some way to setup an alias like this.
>
> Thanks
> Paul Phillips
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>



___________________________________________________
Paul Phillips
Director of Orchestral Activities, Meadows School of the Arts
Southern Methodist University

"You must sing every note you play, sing even through the rests!"
Arturo Toscanini

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: alias

Posted by Paul Phillips <pa...@partitura.com>.
Actually, its a bit more complicated, so I don't think Jay's solution 
(quoted below) will work.

I am using a security constraint with form based authentication.

This means that I have to request a servlet that is in a constrained area. 
The container forwards the request to a login page outside of the 
constrained area.  Once the login is processed, it goes back to the 
originally requested page.

So, I have to actually have the query string passed in during the initial 
login.  That is what I am trying to replace with an alias.

Paul Phillips

--On Sunday, April 7, 2002 12:09 PM -0600 Jay Gardner <gj...@qwest.net> wrote:

> Did you try
>
> <servlet>
>   	<servlet-name>controller</servlet-name>
>   	<servlet-class>controller</servlet-class>
>  	<!--This servlet-class needs to be the actual name of the servlet. If
> name is com.mycompany.myproject.Controller, then that is what needs to
> appear here.-->
> </servlet>
> <servlet-mapping>
>  	 <servlet-name>controller</servlet-name>
>   	<url-pattern>/login</url-pattern>
> </servlet-mapping>
>
> Don't worry about the query string being passed in to the servlet. That
> will be passed by the container from the jsp to the servlet.
>
> Hope this helps!
>
> --Jay Gardner
>
>
> -----Original Message-----
> From: Paul Phillips [mailto:paul@partitura.com]
> Sent: Sunday, April 07, 2002 10:49 AM
> To: Tomcat Users List
> Subject: alias
>
> I need some generic advice...  probably really easy.
>
> I have written an application with a controller servlet.  The controller
> servlet is event driven - every form submit button on one of the jsp pages
> maps to
> "controller?event=DOWHATEVER".  After the controller does its thing, it
> sends the puts the results in a session, and transfers control back to a
> jsp page for display.  My first attempt at MVC.
>
> My initial page is generated when the user types
>
> URL/whatever/controller?event=WELCOME
>
> Now I would like to make an alias that is like:
>
> "URL/whatever/login" which will map to
> "URL/whatever/controller?event=WELCOME".
>
> What is the best way to do that?
>
> Not being much of an expert at the web.xml file, I tried the following
> within web.xml:
>
> <servlet-mapping>
>   <servlet-name>controller</servlet-name>
>   <url-pattern>/controller</url-pattern>
> </servlet-mapping>
>
> <servlet-mapping>
>   <servlet-name>controller?event=WELCOME</servlet-name>
>   <url-pattern>/login</url-pattern>
> </servlet-mapping>
>
> That, most assuredly, did not work.
>
> How should I go about doing this?
>
> I guess I could change the code of my servlet so that if there is no event
> definition provided, it goes to the welcome page...  But it seems that
> there should be some way to setup an alias like this.
>
> Thanks
> Paul Phillips
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>



___________________________________________________
Paul Phillips
Director of Orchestral Activities, Meadows School of the Arts
Southern Methodist University

"You must sing every note you play, sing even through the rests!"
Arturo Toscanini

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: alias

Posted by Jay Gardner <gj...@qwest.net>.
Did you try

<servlet>
  	<servlet-name>controller</servlet-name>
  	<servlet-class>controller</servlet-class>
 	<!--This servlet-class needs to be the actual name of the servlet. If name
is com.mycompany.myproject.Controller, then that is what needs to appear
here.-->
</servlet>
<servlet-mapping>
 	 <servlet-name>controller</servlet-name>
  	<url-pattern>/login</url-pattern>
</servlet-mapping>

Don't worry about the query string being passed in to the servlet. That will
be passed by the container from the jsp to the servlet.

Hope this helps!

--Jay Gardner


-----Original Message-----
From: Paul Phillips [mailto:paul@partitura.com]
Sent: Sunday, April 07, 2002 10:49 AM
To: Tomcat Users List
Subject: alias

I need some generic advice...  probably really easy.

I have written an application with a controller servlet.  The controller
servlet is event driven - every form submit button on one of the jsp pages
maps to
"controller?event=DOWHATEVER".  After the controller does its thing, it
sends the puts the results in a session, and transfers control back to a
jsp page for display.  My first attempt at MVC.

My initial page is generated when the user types

URL/whatever/controller?event=WELCOME

Now I would like to make an alias that is like:

"URL/whatever/login" which will map to
"URL/whatever/controller?event=WELCOME".

What is the best way to do that?

Not being much of an expert at the web.xml file, I tried the following
within web.xml:

<servlet-mapping>
  <servlet-name>controller</servlet-name>
  <url-pattern>/controller</url-pattern>
</servlet-mapping>

<servlet-mapping>
  <servlet-name>controller?event=WELCOME</servlet-name>
  <url-pattern>/login</url-pattern>
</servlet-mapping>

That, most assuredly, did not work.

How should I go about doing this?

I guess I could change the code of my servlet so that if there is no event
definition provided, it goes to the welcome page...  But it seems that
there should be some way to setup an alias like this.

Thanks
Paul Phillips

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>