You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Thinh Doan <td...@twjconsulting.com> on 2001/09/25 22:47:13 UTC
Pls comment on template application
I have 3 different templates (tempA.jsp, tempB.jsp and tempC.jsp). Depends
on the user profile after they login, a session attribute will be set, e.g.
session.setAttribute("user_template", template), to indicate which template
to be used. I'd like to get some ideas on how to switch between these 3
templates based on this session variable.
On idea would be to pass this var into the template insert:
<template:insert template='<%=session.getAttribute("user_template")%>'>
but I don't know if this syntax is legal or recommended. Is there a better
idea?
Thank you very much for your comments.
Thinh
Problem with forward tag in struts-config.xml Action Mappings.
Posted by John Bowen <jo...@sabertoothgames.com>.
Hi,
I just moved my directory structure around for a previously working Struts
app and am having problems with the action mapping forward tags.
Previously all of my JSPs and struts-config.xml were running in the same
webapps directory [/webapps/cowboy].
Now my struts-config.xml is now at the bottom level of the directory
[inside /webapps/cowboy/WEB-INF] and my strut-ized JSP pages are running out
of a subdirectory [/webapps/cowboy/ranch/*.jsp].
I'm mapping by extension:
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
Here's my revised action mapping [all I changed was adding the /ranch
directories to the input and path]:
<action path="horsey"
type="com.gallop.trot.CreateHorse"
name="horseyForm"
scope="request"
input="/ranch/horseinput.jsp">
<forward name="success" path="/ranch/gluefactory.jsp"/>
</action>
... when I try to execute http://www.animalfeed.com/horsey.do I get 404
/gluefactory.jsp was not found on this server.
I find it odd that the 404 doesn't also include the /ranch in the error.
I've tried removing the /ranch in the <forward> tag but I get the exact same
404.
Any ideas what else I can try?
Thanks...
- John
dynamic jsp:includes
Posted by peter <pe...@btinternet.com>.
Is there a way using Struts to create a dynamic jsp:include? For example
I've got a jsp file which needs to include two different jsp files in the
same place, but at different times. I know I could just make two copies of
the parent jsp file with a diffent include in each, but i would prefer it if
i could use the one parent jsp file and place the relevant include file when
it is needed.
Thanks
Peter