You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marco Tedone <m_...@hotmail.com> on 2003/03/16 22:07:11 UTC

[NEWBIE]A very stupid question

I have my application under the context /xml-op/
 
In my struts-config.xml file, I define an action with the path=/Login
 
Anyway, when I want to invoke the Login action as a forward, let's say by
means of a ForwardAction action mapping, in my jsp page, as href I have to
indicate the following: /xml-op/Login.do
 
If I want to invoke the same action from within a form, then I have to omit
the /xml-op/ prefix.
 
Anyone of you does know why?
 
TIA, Marco

Re: [NEWBIE]A very stupid question

Posted by Affan Qureshi <qu...@etilize.com>.
If you are creating a forward in struts config files or actions, you should
ignore the context name completely and write url as "/myAction.do". Struts
takes care of the context path itself.

 If you are creating links simply in HTML then do something like:
request.getContextPath() + "/myAction.do"

Look at the link Tags examples in the example apps that come with struts.

HTH.
Affan
----- Original Message -----
From: "Tony Tahbaz" <tt...@attbi.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, March 17, 2003 2:16 AM
Subject: RE: [NEWBIE]A very stupid question


> How are you creating your link? Are you using the struts-html taglib or
are
> you just using html?
>
> -----Original Message-----
> From: Marco Tedone [mailto:m_tedone@hotmail.com]
> Sent: Sunday, March 16, 2003 2:07 PM
> To: Struts-user-list
> Subject: [NEWBIE]A very stupid question
>
>
> I have my application under the context /xml-op/
>
> In my struts-config.xml file, I define an action with the path=/Login
>
> Anyway, when I want to invoke the Login action as a forward, let's say by
> means of a ForwardAction action mapping, in my jsp page, as href I have to
> indicate the following: /xml-op/Login.do
>
> If I want to invoke the same action from within a form, then I have to
omit
> the /xml-op/ prefix.
>
> Anyone of you does know why?
>
> TIA, Marco
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


Re: struts' compile

Posted by Gemes Tibor <ti...@i-trade.hu>.
errise@hotmail.com wrote:

>The struts page translate  into  .java file by  web server when first open the web page.
>In  struts file,each tag will be transtlate into a object,when the tag's is too many,and the object is generated too many,and  the java file will become very huge,and speed will be very slow.
>How can I do with it?
>  
>

This depends on your jsp compiler. Jasper2 compiles a way 
better/faster/structured code. Jasper2 is included in tomcat4.1 series.

Hth,

Tib



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


struts' compile

Posted by er...@hotmail.com.
The struts page translate  into  .java file by  web server when first open the web page.
In  struts file,each tag will be transtlate into a object,when the tag's is too many,and the object is generated too many,and  the java file will become very huge,and speed will be very slow.
How can I do with it?

Re: [NEWBIE]A very stupid question

Posted by Nicolas De Loof <ni...@cgey.com>.
You should use this (notice <html:rewrite> tag):

<script language="JavaScript">
  document.write("<tr><td height='200'><p class='enterLink'>Welcome to
XML-OP<br><a href='<html:rewrite page="/xml-op/Login.do"/>'
class='enterLink'>Click here to log in</a></p></td></tr>")
</script>



> My link is created as follows:
>
> <script language="JavaScript">
> document.write("<tr><td height='200'><p
> class='enterLink'>Welcome to XML-OP<br><a href='/xml-op/Login.do'
> class='enterLink'>Click here to log in</a></p></td></tr>")
> </script>
>
> Marco
>
> > -----Original Message-----
> > From: Tony Tahbaz [mailto:ttahbaz@attbi.com]
> > Sent: Sunday, March 16, 2003 9:16 PM
> > To: Struts Users Mailing List
> > Subject: RE: [NEWBIE]A very stupid question
> >
> >
> > How are you creating your link? Are you using the struts-html
> > taglib or are you just using html?
> >
> > -----Original Message-----
> > From: Marco Tedone [mailto:m_tedone@hotmail.com]
> > Sent: Sunday, March 16, 2003 2:07 PM
> > To: Struts-user-list
> > Subject: [NEWBIE]A very stupid question
> >
> >
> > I have my application under the context /xml-op/
> >
> > In my struts-config.xml file, I define an action with the
path=/Login
> >
> > Anyway, when I want to invoke the Login action as a forward,
> > let's say by means of a ForwardAction action mapping, in my
> > jsp page, as href I have to indicate the following:
/xml-op/Login.do
> >
> > If I want to invoke the same action from within a form, then
> > I have to omit the /xml-op/ prefix.
> >
> > Anyone of you does know why?
> >
> > TIA, Marco
> >
> >
>
> --------------------------------------------------------------------
-
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


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


RE: [NEWBIE]A very stupid question

Posted by Marco Tedone <m_...@hotmail.com>.
My link is created as follows:

<script language="JavaScript">
		document.write("<tr><td height='200'><p
class='enterLink'>Welcome to XML-OP<br><a href='/xml-op/Login.do'
class='enterLink'>Click here to log in</a></p></td></tr>")
</script>

Marco

> -----Original Message-----
> From: Tony Tahbaz [mailto:ttahbaz@attbi.com] 
> Sent: Sunday, March 16, 2003 9:16 PM
> To: Struts Users Mailing List
> Subject: RE: [NEWBIE]A very stupid question
> 
> 
> How are you creating your link? Are you using the struts-html 
> taglib or are you just using html?
> 
> -----Original Message-----
> From: Marco Tedone [mailto:m_tedone@hotmail.com]
> Sent: Sunday, March 16, 2003 2:07 PM
> To: Struts-user-list
> Subject: [NEWBIE]A very stupid question
> 
> 
> I have my application under the context /xml-op/
> 
> In my struts-config.xml file, I define an action with the path=/Login
> 
> Anyway, when I want to invoke the Login action as a forward, 
> let's say by means of a ForwardAction action mapping, in my 
> jsp page, as href I have to indicate the following: /xml-op/Login.do
> 
> If I want to invoke the same action from within a form, then 
> I have to omit the /xml-op/ prefix.
> 
> Anyone of you does know why?
> 
> TIA, Marco
> 
> 

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


RE: [NEWBIE]A very stupid question

Posted by Marco Tedone <m_...@hotmail.com>.
Thank you Carl

> -----Original Message-----
> From: Carl Fyffe [mailto:struts@sixty4bit.com] 
> Sent: Monday, March 17, 2003 3:50 AM
> To: 'Struts Users Mailing List'
> Subject: RE: [NEWBIE]A very stupid question
> 
> 
> Marco, You should use the html:link tag.  Use the page 
> instead of href. Page will prepend the correct context path 
> for you.  Html:rewrite does this as well so you can use that 
> for linking to images and what not. Here is an example:
> 
> <html:link page="/Login.do">Login</html:link>
> 
> So what Struts will actually output would be:
> 
> <a href="/xml-op/Login.do">Login</a>
> 
> Given that xml-op is your context. 
> 
> Hth,
> 
> Carl
> 
> -----Original Message-----
> From: Tony Tahbaz [mailto:ttahbaz@attbi.com] 
> Sent: Sunday, March 16, 2003 4:16 PM
> To: Struts Users Mailing List
> Subject: RE: [NEWBIE]A very stupid question
> 
> 
> How are you creating your link? Are you using the struts-html 
> taglib or are you just using html?
> 
> -----Original Message-----
> From: Marco Tedone [mailto:m_tedone@hotmail.com]
> Sent: Sunday, March 16, 2003 2:07 PM
> To: Struts-user-list
> Subject: [NEWBIE]A very stupid question
> 
> 
> I have my application under the context /xml-op/
> 
> In my struts-config.xml file, I define an action with the path=/Login
> 
> Anyway, when I want to invoke the Login action as a forward, 
> let's say by means of a ForwardAction action mapping, in my 
> jsp page, as href I have to indicate the following: /xml-op/Login.do
> 
> If I want to invoke the same action from within a form, then 
> I have to omit the /xml-op/ prefix.
> 
> Anyone of you does know why?
> 
> TIA, Marco
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 

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


RE: [NEWBIE]A very stupid question

Posted by Carl Fyffe <st...@sixty4bit.com>.
Marco, You should use the html:link tag.  Use the page instead of href.
Page will prepend the correct context path for you.  Html:rewrite does
this as well so you can use that for linking to images and what not.
Here is an example:

<html:link page="/Login.do">Login</html:link>

So what Struts will actually output would be:

<a href="/xml-op/Login.do">Login</a>

Given that xml-op is your context. 

Hth,

Carl

-----Original Message-----
From: Tony Tahbaz [mailto:ttahbaz@attbi.com] 
Sent: Sunday, March 16, 2003 4:16 PM
To: Struts Users Mailing List
Subject: RE: [NEWBIE]A very stupid question


How are you creating your link? Are you using the struts-html taglib or
are you just using html?

-----Original Message-----
From: Marco Tedone [mailto:m_tedone@hotmail.com]
Sent: Sunday, March 16, 2003 2:07 PM
To: Struts-user-list
Subject: [NEWBIE]A very stupid question


I have my application under the context /xml-op/

In my struts-config.xml file, I define an action with the path=/Login

Anyway, when I want to invoke the Login action as a forward, let's say
by means of a ForwardAction action mapping, in my jsp page, as href I
have to indicate the following: /xml-op/Login.do

If I want to invoke the same action from within a form, then I have to
omit the /xml-op/ prefix.

Anyone of you does know why?

TIA, Marco


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


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


RE: [NEWBIE]A very stupid question

Posted by Tony Tahbaz <tt...@attbi.com>.
How are you creating your link? Are you using the struts-html taglib or are
you just using html?

-----Original Message-----
From: Marco Tedone [mailto:m_tedone@hotmail.com]
Sent: Sunday, March 16, 2003 2:07 PM
To: Struts-user-list
Subject: [NEWBIE]A very stupid question


I have my application under the context /xml-op/

In my struts-config.xml file, I define an action with the path=/Login

Anyway, when I want to invoke the Login action as a forward, let's say by
means of a ForwardAction action mapping, in my jsp page, as href I have to
indicate the following: /xml-op/Login.do

If I want to invoke the same action from within a form, then I have to omit
the /xml-op/ prefix.

Anyone of you does know why?

TIA, Marco


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