WW-2452 - Need advice on fix

2008-01-23 Thread Al Sutton

Hi All,

I've finally found the cause of the "space in the path" problem for the 
FreeMarker test which was failing and registered it as WW-2452.


Now the simplest fix I can see is to change the offending line of code from;

servletContext.setRealPath(FreeMarkerResultTest.class.getResource("someFreeMarkerFile.ftl").getFile());

to

servletContext.setRealPath(FreeMarkerResultTest.class.getResource("someFreeMarkerFile.ftl").getFile().replaceAll("%20", 
" "));


where the replaceAll changes back the %20's to spaces and thus the path is 
OK.


Does anyone feel this is too much of a hack and knows a better way, because 
I'm a bit uncomfortable with it?


Al.


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



Re: WW-2452 - Need advice on fix

2008-01-23 Thread Antonio Petrelli
2008/1/23, Al Sutton <[EMAIL PROTECTED]>:
>
> Hi All,
>
> I've finally found the cause of the "space in the path" problem for the
> FreeMarker test which was failing and registered it as WW-2452.
>
> Now the simplest fix I can see is to change the offending line of code
> from;
>
> servletContext.setRealPath(FreeMarkerResultTest.class.getResource("
> someFreeMarkerFile.ftl").getFile());
>
> to
>
> servletContext.setRealPath(FreeMarkerResultTest.class.getResource("
> someFreeMarkerFile.ftl").getFile().replaceAll("%20",
> " "));
>
> where the replaceAll changes back the %20's to spaces and thus the path is
> OK.
>
> Does anyone feel this is too much of a hack and knows a better way,
> because
> I'm a bit uncomfortable with it?



For me it's ok. For some reasons, URIs accepts spaces and URLs want %20 (or
was it the opposite?). This is not a hack, since it is test code.

Antonio


Re: svn commit: r614488 - in /struts/struts2/trunk: core/pom.xml plugins/dojo/pom.xml

2008-01-23 Thread Don Brown
Don't forget to deploy the snapshot before updating the pom.  Also,
when I deployed the struts-annotations snapshot, I noticed it had a
unique snapshot version, so I changed the poms to use it, and kicked
off the build again, which just passed.

Don

On 1/23/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Author: husted
> Date: Wed Jan 23 02:56:48 2008
> New Revision: 614488
>
> URL: http://svn.apache.org/viewvc?rev=614488&view=rev
> Log:
> WW-2451 "Updated poms to use struts annotations 1.0.3-SNAPSHOT to fix 
> dependency issue" Apply patch suggested by Al Sutton, but leave issue open 
> pending a 1.0.3 release of Struts-Annotations.
>
> Modified:
> struts/struts2/trunk/core/pom.xml
> struts/struts2/trunk/plugins/dojo/pom.xml

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



logic:iterate problem

2008-01-23 Thread Paz Belmonte
Hello, I have a problem with a logic:iterate tag.
I have one collection.
In my jsp i need two logic:iterate. each of then will be showing one
information.


  
   ${disamElements.name}
  

  
  ${disamElems.type}
  

Then, this page generate this error:

javax.servlet.ServletException: Cannot create iterator for this collection


If remove one of then, work correctly.


Java version can be the problem?  I work with java1.5. and I try  with
java1.4  and It works perfectly.

Somebody can help me.
Thanks
Paz


Re: logic:iterate problem

2008-01-23 Thread Antonio Petrelli
Please ask this question to the Struts Users mailing list:
http://struts.apache.org/mail.html

Antonio

2008/1/23, Paz Belmonte <[EMAIL PROTECTED]>:
> Hello, I have a problem with a logic:iterate tag.
> I have one collection.
> In my jsp i need two logic:iterate. each of then will be showing one
> information.
>
>
>   
>${disamElements.name}
>   
>
>   
>   ${disamElems.type}
>   
>
> Then, this page generate this error:
>
> javax.servlet.ServletException: Cannot create iterator for this collection
>
>
> If remove one of then, work correctly.
>
>
> Java version can be the problem?  I work with java1.5. and I try  with
> java1.4  and It works perfectly.
>
> Somebody can help me.
> Thanks
> Paz
>

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



Re: WW-2452 - Need advice on fix

2008-01-23 Thread Brian Relph
This might be prettier -

servletContext.setRealPath(*new* File(FreeMarkerResultTest.*class*
.getResource("someFreeMarkerFile.ftl").toURI()).toURL().getFile());



Brian


Re: WW-2452 - Need advice on fix

2008-01-23 Thread Antonio Petrelli
2008/1/23, Brian Relph <[EMAIL PROTECTED]>:
> This might be prettier -
>
> servletContext.setRealPath(*new* File(FreeMarkerResultTest.*class*
> .getResource("someFreeMarkerFile.ftl").toURI()).toURL().getFile());

Does it transform spaces into %20?

Antonio

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



Re: WW-2452 - Need advice on fix

2008-01-23 Thread Brian Relph
my junit shows it does the opposite, although i am not testing the exact
code ...

creating a file from a URI decodes the %20 along with any other utf-8
encoded characters

also, my code was html-styled, so it came out a little funny:


servletContext.setRealPath(new File(FreeMarkerResultTest.class.getResource(
"someFreeMarkerFile.ftl").toURI()).toURL().getFile());


On 1/23/08, Antonio Petrelli <[EMAIL PROTECTED]> wrote:

> 2008/1/23, Brian Relph <[EMAIL PROTECTED]>:
> > This might be prettier -
> >
> > servletContext.setRealPath(*new* File(FreeMarkerResultTest.*class*
> > .getResource("someFreeMarkerFile.ftl").toURI()).toURL().getFile());
>
> Does it transform spaces into %20?
>
> Antonio
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: WW-2452 - Need advice on fix

2008-01-23 Thread Antonio Petrelli
2008/1/23, Brian Relph <[EMAIL PROTECTED]>:
>
> my junit shows it does the opposite, although i am not testing the exact
> code ...



Well, it's just what I meant :-) Time for mind-reversing.

Antonio


Re: [S2] - FilterDispatcher and ActionContextCleanup (WW-2240 FileUploadInterceptor causes null pointer exception)

2008-01-23 Thread Nils-Helge Garli Hegvik
I would really like a second opinion on this issue. Please let me know
if something I wrote was unclear.

Nils-H

On Jan 20, 2008 1:03 PM, Nils-Helge Garli Hegvik <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I've been debugging WW-2240 (had to install WebLogic 10 to reproduce
> it) and have seen some strange behavior (at least I think so) in
> the ActionContext initialization and cleanup performed by the
> FilterDispatcher. The problem is that the cleanup of the ActionContext
> (ActionContext.setContext(null)) happens before the
> FileUploadInterceptor is finished executing, so when a log statement
> in the interceptor tries to access a value in the ActionContext, it
> fails with an NPE. I think I've traced it down to this:
>
> In the FilterDispatcher a call to ActionContextCleanUp.cleanUp(req) is
> invoked in the finally block. In ActionContextCleanup.cleanUp, the
> request is checked for a COUNT request attribute to see if the context
> should be cleaned up. And in this case, this attribute is always null,
> since it's only set and incremented in ActionContextCleanUp.doFilter
> (which in this case is not configured in web.xml). So it seems strange
> to me that the FilterDispatcher tries to clean up the context when it
> apparently does not keep track of if it should be cleaned or not
> ("nested" invocation)?
>
> Is this an actual bug, or am I just overlooking something?
>
> I could only reproduce this in WebLogic 10. So it's apparently
> container dependent how this is handled.
>
> Nils-H
>

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



Tiles : java.lang.NoSuchMethodError: org.apache.tiles.TilesContainer.render

2008-01-23 Thread Jayakrishnan KR
Hi,
I am using Tiles 2.0.5 with Struts 2.0.6 in tomcat 6.0.14.. I am congfiguring 
the tiles thruougdefining it as servlet in the web.xml as follows : 
   
 tiles 
 
org.apache.tiles.web.startup.TilesServlet

definitions-config
/WEB-INF/tiles.xml 
 
2 
 .
and using the result type as tiles default in struts.xml as follows:

 
.
I have tiles-api-2.0.5, tiles-2.0.5-core, tiles-2.0.5-jsp jars in my lib.
After that i deployed that in tomcat and trying to acces the page from 
index.jsp file, it throws me the error as follows : 
 SEVERE: Servlet.service() for servlet default threw exception
 [java] java.lang.NoSuchMethodError: 
org.apache.tiles.TilesContainer.render(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/String;)V
 [java] at 
org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:104)
 [java] at 
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
 [java] at 
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:343)
   ...

I am attaching the project file with this. I removed lib coz of size concern.
So please help me to solve this issue .

Thanks in advance,
JK

I am
-
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=207829&messageID=285648#285648

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