You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by john lee <sh...@yahoo.com> on 2007/05/27 17:42:32 UTC

how to embed struts tag inside JSP?

I try to embed struts tag inside JSP, but looks like not works? how come? any idea?
   
  out.println("<logic:redirect href="why.do"/>");
   
  but not working.
   
  tks in advance
   
  john

       
---------------------------------
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 

Re: how to embed struts tag inside JSP?

Posted by Dave Newton <ne...@yahoo.com>.
--- john lee <sh...@yahoo.com> wrote:
> inside JSP, actually what i try to do is the
> following:
>    
>   inside JSP:
>    
>    ...
>    if (result.compareTo("Success")==0) {
>      out.println("<logic:redirect href="why.do" />);
>    else
>      ...

Well, that's probably a sub-optimal solution for a lot
of reasons. If you are dead-set on using scriptlets,
I'm not going to be much help (by choice :)

You might want to consider using <logic:equals.../>
or, better yet, switch to JSTL when it (JSTL) has a
tag that duplicates Struts tag functionality.

d.



       
____________________________________________________________________________________Got a little couch potato? 
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz 

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


Re: how to embed struts tag inside JSP?

Posted by john lee <sh...@yahoo.com>.
inside JSP, actually what i try to do is the following:
   
  inside JSP:
   
   ...
   if (result.compareTo("Success")==0) {
     out.println("<logic:redirect href="why.do" />);
   else
     ...
   
  john

Dave Newton <ne...@yahoo.com> wrote:
  --- john lee wrote:
> I try to embed struts tag inside JSP

Normally you "embed a tag" inside a JSP by just using
the tag, like you're supposed to. For example:

  
  
   
... etc ...

> but looks like not works? how come? any idea?

Because you have a fundamental misconception about how
tags work, I think.

> out.println("");

What, exactly, are you trying to do? Where are you
invoking this code, in an Action, or a JSP?

d.




____________________________________________________________________________________Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC

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




       
---------------------------------
Choose the right car based on your needs.  Check out Yahoo! Autos new Car Finder tool.

Re: how to embed struts tag inside JSP?

Posted by Dave Newton <ne...@yahoo.com>.
--- john lee <sh...@yahoo.com> wrote:
> I try to embed struts tag inside JSP

Normally you "embed a tag" inside a JSP by just using
the tag, like you're supposed to. For example:

<ul>
  <li><logic:redirect href="why.do"/></li>
  ... etc ...

> but looks like not works? how come? any idea?

Because you have a fundamental misconception about how
tags work, I think.

>   out.println("<logic:redirect href="why.do"/>");

What, exactly, are you trying to do? Where are you
invoking this code, in an Action, or a JSP?

d.



       
____________________________________________________________________________________Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC

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