struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesús Gallardo <jgalla...@sync.es>
Subject Re: Struts basic forwards
Date Thu, 14 May 2009 11:46:40 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-2" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Forgive me, you have reason.<br>
<br>
Using urls like:<br>
<br>
<a class="moz-txt-link-freetext"
 href="http://localhost:8180/Tuto/SayHello.do">http://localhost:8180/Tuto/SayHello.do</a><br>
<a class="moz-txt-link-freetext"
 href="http://localhost:8180/Tuto/SayGoodBye.do">http://localhost:8180/Tuto/SayGoodBye.do</a><br>
<br>
It show 2 messages the Hello and Goodbye, correctly.<br>
<br>
The problem occurs in which the index should be 2 links:<br>
<br>
         &lt;html:link action="SayHello.do"&gt; Hello &lt;/ html:
link&gt;<br>
         Adios &lt;html:link action="SayGoodBye.do"&gt; &lt;/ html:
link&gt;<br>
<br>
Logically if I remove the 2 links the rest of the load index correctly.<br>
<br>
The problem is if you can not resolve the action and gives an exception.<br>
<br>
Paweł Wielgus wrote:
<blockquote
 cite="mid:5e5424000905140358y3b44b2c2p94819014004fdc42@mail.gmail.com"
 type="cite">
  <pre wrap="">Hi Jesús,
first of all without globalforwards block it should work as well.
Then try not to put anything inside those jsp files,
maybe something is wrong there.

In browser entering address like:
<a class="moz-txt-link-freetext" href="http://yourserver/yourapp/SayHello.do">http://yourserver/yourapp/SayHello.do</a>
should show hello.jsp where yourapp is application context or nothing
if it's run as a root.

You can also show more of that exception, not just first line.

Best greetings,
Paweł Wielgus.


El día 14 de mayo de 2009 12:44, Gallardo <a class="moz-txt-link-rfc2396E" href="mailto:jgallardo@sync.es">&lt;jgallardo@sync.es&gt;</a>
escribió:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi for all.

Firstly thank you all for reading this email, I hope you can help me,
I'm starting with struts.

I want to do something as simple as 2 links to pass control to 2
different JPS.
as follows.

        &lt;html:link action="SayHello.do"&gt; Hello &lt;/ html: link&gt;
        &lt;html:link action="SayGoodBye.do"&gt; Bye &lt;/ html: link&gt;

In struts-conf.xml have defined the following action-mappings and
global-forwards

    &lt;global-forwards&gt;
        &lt;forward name="welcome" path="/Welcome.do"/&gt;
        &lt;forward name="sayhello" path="/SayHello.do"/&gt;
        &lt;forward name="saygoodbye" path="/SayGoodBye.do"/&gt;
    &lt;/ global-forwards&gt;

    &lt;action-mappings&gt;
        &lt;action path="/Welcome" forward="/welcomeStruts.jsp"/&gt;
        &lt;action path="/SayHello" forward="/WEB-INF/hello.jsp"/&gt;
        &lt;action path="/SayGoodBye" forward="/WEB-INF/bye.jsp"/&gt;
    &lt;/ action-mappings&gt;

And the end result is an exception type

javax.servlet.ServletException: Could not initialize class
org.apache.jasper.runtime.BodyContentImpl

I believed that this would work, otherwise I did not understand how
struts work.
Someone can tell me if my fault or failure of a dependency?

Tnks for all :)
--
GPG Public Key: <a class="moz-txt-link-freetext" href="http://sync.es/seguridad/Jesus_Sync.asc">http://sync.es/seguridad/Jesus_Sync.asc</a>
Key fingerprint = 8FFC 19B4 5F81 FC66 965C ACCA 01F6 2DA0 8BBA 51EC
--


    </pre>
  </blockquote>
  <pre wrap=""><!---->
---------------------------------------------------------------------
To unsubscribe, e-mail: <a class="moz-txt-link-abbreviated" href="mailto:user-unsubscribe@struts.apache.org">user-unsubscribe@struts.apache.org</a>
For additional commands, e-mail: <a class="moz-txt-link-abbreviated" href="mailto:user-help@struts.apache.org">user-help@struts.apache.org</a>

  </pre>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
Jesús Gallardo<br>
<br>
Jefe de Proyecto Sync.es<br>
Tlf: 671 - 51 - 53 - 75<br>
<a class="moz-txt-link-freetext" href="http://www.sync.es">http://www.sync.es</a><br>
--<br>
GPG Public Key: <a class="moz-txt-link-freetext" href="http://sync.es/seguridad/Jesus_Sync.asc">http://sync.es/seguridad/Jesus_Sync.asc</a><br>
Key fingerprint = 8FFC 19B4 5F81 FC66 965C ACCA 01F6 2DA0 8BBA 51EC<br>
--<br>
</div>
</body>
</html>

Mime
View raw message