Re: tiles : "Path teste does not start with a "/" character"

2006-03-09 Thread Antonio Petrelli

vinicius ha scritto:

Em Qui 09 Mar 2006 08:54, Antonio Petrelli escreveu:
  

but my question still the same:
I just want to do a forward and change one tile of the layout, so i have
to especify an action class??
  

Short answer: yes.
If you want to forward to a definition, say, in case of "success" or to
another definition on "failure", you have to use an Action and two
forwards, each of them references a different definition.
You are using an ActionForward, it forwards only to ONE destination (in
your case, ONE definition). If you need more control, I am sorry but you
have to use an Action.



thank you Antonio, but an ActionForward like iam doing, i don't have much 
control but it would have to work! ??
  

Sorry?
and if use an Action, what type of class I have to use if I just want to do a 
forward??
  

in your "execute" method put:
return mapping.findForward("nameOfTheForward");
You can also use a newly created ActionForward (but I never tried it!)
return new ActionForward("name.of.the.definition", redirectFlag);
Ciao


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tiles : "Path teste does not start with a "/" character"

2006-03-09 Thread vinicius
Em Qui 09 Mar 2006 08:54, Antonio Petrelli escreveu:
> > but my question still the same:
> > I just want to do a forward and change one tile of the layout, so i have
> > to especify an action class??
>
> Short answer: yes.
> If you want to forward to a definition, say, in case of "success" or to
> another definition on "failure", you have to use an Action and two
> forwards, each of them references a different definition.
> You are using an ActionForward, it forwards only to ONE destination (in
> your case, ONE definition). If you need more control, I am sorry but you
> have to use an Action.

thank you Antonio, but an ActionForward like iam doing, i don't have much 
control but it would have to work! ??

and if use an Action, what type of class I have to use if I just want to do a 
forward??

-- 
At.:
Vinicius Dittgen
Analista Programador - T.I.
www.fcdl-rs.com.br

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tiles : "Path teste does not start with a "/" character"

2006-03-09 Thread Antonio Petrelli

vinicius ha scritto:

but my question still the same:
I just want to do a forward and change one tile of the layout, so i have to 
especify an action class??


My forward and action:
  

  
  

Short answer: yes.
If you want to forward to a definition, say, in case of "success" or to 
another definition on "failure", you have to use an Action and two 
forwards, each of them references a different definition.
You are using an ActionForward, it forwards only to ONE destination (in 
your case, ONE definition). If you need more control, I am sorry but you 
have to use an Action.

Ciao
Antonio

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tiles : "Path teste does not start with a "/" character"

2006-03-09 Thread vinicius
Em Qui 09 Mar 2006 06:41, Antonio Petrelli escreveu:
> vinicius ha scritto:
> >> 2)  Is your tiles-defs.xml file in the right place?
> >
> > Yes, in agreement  with struts-config.xml:
> > et-property property="definitions-config"
> >value="/conf/tiles-defs.xml" />
>
> This is a pretty strange place for tiles-defs.xml. Is it really under
> /conf/tiles_defs.xml???
I create a conf directory to store the config files that change more 
frequently!!

but my question still the same:
I just want to do a forward and change one tile of the layout, so i have to 
especify an action class??

My forward and action:
  

  

-- 
At.:
Vinicius Dittgen
Analista Programador - T.I.
www.fcdl-rs.com.br

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tiles : "Path teste does not start with a "/" character"

2006-03-09 Thread Antonio Petrelli

vinicius ha scritto:

2)  Is your tiles-defs.xml file in the right place?


Yes, in agreement  with struts-config.xml:
et-property property="definitions-config"
   value="/conf/tiles-defs.xml" />
  
This is a pretty strange place for tiles-defs.xml. Is it really under 
/conf/tiles_defs.xml???


Ciao
Antonio

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tiles : "Path teste does not start with a "/" character"

2006-03-08 Thread vinicius
Em Qua 08 Mar 2006 14:15, Greg Reddin escreveu:
> On Mar 8, 2006, at 10:49 AM, Joe Germuska wrote:
> > At 10:36 AM -0600 3/8/06, Greg Reddin wrote:
> >> On Mar 8, 2006, at 7:14 AM, vinicius wrote:
> >>> My forward and action:
> >>>
> >>>  >>> name="institucional"
> >>> path="/Institucional.do"/>
> >>>
> >>>   >>> path="/Institucional"
> >>> forward=".teste"/>
>
> ...
>
> > Which is a long way of saying that a tiles definition can be any
> > string, but if you get an IllegalArgumentException "Path XXX does
> > not start with a "/" character", the reason is that Tiles was not
> > able to replace the ActionForward whose path was a tiles definition
> > with one whose path is acceptable to
> > ServletContext.getRequestDispatcher()
>
> The thing that baffles me about that is that the action mapping is
> not specifying an action class.  So the only way it would not be able
> to find the forward is if either the ".teste" def doesn't exist or
> the TilesRequestProcessor is not specified.  I guess you should check
> the following:
>
> 1)  Any startup errors with Tiles?
No

> 2)  Is your tiles-defs.xml file in the right place?
Yes, in agreement  with struts-config.xml:
et-property property="definitions-config"
   value="/conf/tiles-defs.xml" />

> 3)  Are you using TilesRequestProcessor?
i think so, see the stack trace:
java.lang.RuntimeException: Path teste.tiles does not start with a "/" 
character
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1055)
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)

--

My question is: 
I just want to do a forward and change one tile of the layout, so i have to 
especify an action class??

-- 
At.:
Vinicius Dittgen
Analista Programador - T.I.
www.fcdl-rs.com.br

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tiles : "Path teste does not start with a "/" character"

2006-03-08 Thread Greg Reddin


On Mar 8, 2006, at 10:49 AM, Joe Germuska wrote:


At 10:36 AM -0600 3/8/06, Greg Reddin wrote:


On Mar 8, 2006, at 7:14 AM, vinicius wrote:



My forward and action:



 





...
Which is a long way of saying that a tiles definition can be any  
string, but if you get an IllegalArgumentException "Path XXX does  
not start with a "/" character", the reason is that Tiles was not  
able to replace the ActionForward whose path was a tiles definition  
with one whose path is acceptable to  
ServletContext.getRequestDispatcher()


The thing that baffles me about that is that the action mapping is  
not specifying an action class.  So the only way it would not be able  
to find the forward is if either the ".teste" def doesn't exist or  
the TilesRequestProcessor is not specified.  I guess you should check  
the following:


1)  Any startup errors with Tiles?
2)  Is your tiles-defs.xml file in the right place?
3)  Are you using TilesRequestProcessor?

Greg


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tiles : "Path teste does not start with a "/" character"

2006-03-08 Thread Joe Germuska

At 10:36 AM -0600 3/8/06, Greg Reddin wrote:

On Mar 8, 2006, at 7:14 AM, vinicius wrote:


My forward and action:



 







my tiles.defs.xml






Does it work to specify a Tiles Forward that begins with a "." or 
will it try to find a relative URL?  That looks a bit strange to me 
and I'm not sure if I'd expect it to work.  I'd try using a name 
like teste.tiles in your forward and tiles def.


My team uses use the ".x.y" naming convention for Tiles universally 
so that they are easily visually distinguished -- they are definitely 
legal.


What happens is that the Tiles RequestProcessor tries to look up the 
tiles def name (a pure literal string match) and if it finds it, it 
changes the operative ActionForward to one whose path is the base 
path of the tiles definition.  Then, control resumes as if Tiles were 
not being used and processForward tries to use 
RequestDispatcher.forward(req,resp) using the path in the 
ActionForward.  (or in Struts 1.3, the PerformForward command 
executes.)


Which is a long way of saying that a tiles definition can be any 
string, but if you get an IllegalArgumentException "Path XXX does not 
start with a "/" character", the reason is that Tiles was not able to 
replace the ActionForward whose path was a tiles definition with one 
whose path is acceptable to ServletContext.getRequestDispatcher()


Joe

--
Joe Germuska
[EMAIL PROTECTED] * http://blog.germuska.com


"You really can't burn anything out by trying something new, and
even if you can burn it out, it can be fixed.  Try something new."
-- Robert Moog

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tiles : "Path teste does not start with a "/" character"

2006-03-08 Thread Greg Reddin


On Mar 8, 2006, at 7:14 AM, vinicius wrote:


My forward and action:



 







my tiles.defs.xml






Does it work to specify a Tiles Forward that begins with a "." or  
will it try to find a relative URL?  That looks a bit strange to me  
and I'm not sure if I'd expect it to work.  I'd try using a name like  
teste.tiles in your forward and tiles def.


Greg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tiles : "Path teste does not start with a "/" character"

2006-03-08 Thread Joe Germuska

At 10:14 AM -0300 3/8/06, vinicius wrote:

my stack trace:

java.lang.RuntimeException: Path teste does not start with a "/" character


When using Tiles, interpret this message to mean that your path is 
not defined as a tile.  The error cannot be more meaningful because 
Tiles is meant to co-exist peacefully with other usages -- so if 
tiles doesn't recognize a path, it simply does nothing, leading to an 
error later on.


From your tiles config, it would appear that you want to go to the 
path ".teste", note "teste" (note the leading "." character.)  From 
your Struts config, it appears that's where you are intending to go, 
but the actual exception indicates that you are somehow passing a 
different value.


Joe

org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1055) 

org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263) 

org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1000) 

org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:345) 


org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:560)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:209)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
sun.reflect.GeneratedMethodAccessor393.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:272)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)

---

My forward and action:



 

---

My plugin conf.:

  

  
  
  
  


---

my tiles.defs.xml









   

   






---
--
At.:
Vinicius Dittgen
Analista Programador - T.I.
www.fcdl-rs.com.br

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Joe Germuska
[EMAIL PROTECTED] * http://blog.germuska.com


"You really can't burn anything out by trying something new, and
even if you can burn it out, it can be fixed.  Try something new."
-- Robert Moog

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]