struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Darren Hall" <dh...@utrs.com>
Subject RE: configuring tiles with struts 1.2.9
Date Thu, 07 Sep 2006 17:26:47 GMT
Ok, maybe I'm approaching this from the wrong direction.
In my web.xml, I have an ActionServlet called "front-controller" mapped to
"/flc". Anything with the /flc URI will get routed to the front-controller.
Additionally my welcome-file-list specifies index.jsp as the default page.

I've set up tiles by defining the plug-in in my struts-config.xml file and
specifying "TilesRequestProcessor" as my controller class in struts-config.
I've created a tiles-def.xml file and set it as a property in the tiles
plug-in.

In my tiles-def.xml file, I've defined a layout called "home.page". All jsp
pages related to the layout have been created and reside where they are
supposed to. In my struts-config.xml file, I've created an action mapping as
follows:
  <action-mappings>
    <action
      path="/home "
      type="org.apache.struts.actions.ForwardAction"
      parameter="home.page"

Apparently, I've done something wrong because I *expect* struts to see the
"/home" uri request come in, look up the mapping, and find that it is
supposed to display the definition of "home.page" i.e. the layout I've
defined. Instead I get the tomcat error "The requested resource
(/home/home.page) is not available."

What am I doing wrong?

Darren


-----Original Message-----
From: Antonio Petrelli [mailto:brenmcguire@tariffenet.it] 
Sent: Thursday, September 07, 2006 10:50 AM
To: Struts Users Mailing List
Subject: Re: configuring tiles with struts 1.2.9

Darren Hall ha scritto:
> Isn't the ".do" extension just a placeholder for ".jsp" or some other
> extension that is mapped in your struts-congif.xml?
>   

In fact you configure it in web.xml (when you configure the 
ActionServlet), and anyway the welcome file is treated as a different 
entity. I really don't know why you cannot use an action as a homepage, 
but that's it...
> I was also under the impression (maybe incorrectly) that I could map a URI
> to a file (or in this case a tile definition) in my struts-config.xml and
> also associate action classes with my tiles.
>   

In fact you associated an action forward to a tile, but action forwards 
are actions and they must be called as actions (usually using a ".do" at 
the end).
You are using your Tiles definition name as a "forward" and it works (or 
"it should work" :-) ) because of the TilesRequestProcessor.

I hope I cleared your doubts.

Ciao
Antonio


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



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


Mime
View raw message