Re: [jetty-user] mvn:jetty ServletContext.getRealPath("") and ServletRequest.getRealPath("") return source folder instead of target folder?

Jan Bartel <[email protected]>
Newsgroups gmane.comp.java.jetty.support
Organization Webtide
Message-ID <[email protected]>
Hi Misha,

The point of the mvn jetty:run goal is to operate on an
unassembled webapp. Therefore, your static content is
sourced from src/main/webapp (or wherever you have configured
it to be). So if you ask for the "realPath" of something
that is in src/main/webapp, that's the directory you'll
get back.

If your webapp does dynamic creation of files on the fly
inside the webapp, then I suggest you use the mvn jetty:run-exploded
goal instead, whereby all the components of your webapp are
assembled into the /target directory.

cheers
Jan




On 27/09/10 13:39, Misha Koshelev wrote:
> Dear All:
>
> My apologies for bothering... this is related to
> http://tickets.openmrs.org/browse/TRUNK-1760
>
> It can be easily tested with the following commands:
> mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes
> -DarchetypeArtifactId=appfuse-light-struts-archetype
> -DarchetypeVersion=2.1.0-M1 -DgroupId=com.mycompany
> -DartifactId=myproject
> cd myproject
> patch -p0<  diff
> cd myproject
> mvn clean install -DskipTests&&  mvn jetty:run
>
> The diff file can be found here:
> http://old.nabble.com/file/p29815681/diff
>
> Now, navigate to
> http://localhost:8080/
> in a browser and this will point to
> !!! /home/misha/workspace/myproject/src/main/resources
>
> Should this not, instead, point to?
> ./target/classes
> or
> ./target/myproject-2.1.0-M1/WEB-INF/classes
>
> Is it possible to modify this behavior?
>
> Thank you so much
>
> Yours
> Misha Koshelev
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>      http://xircles.codehaus.org/manage_email
>
>
>


-- 
Jan Bartel, Webtide LLC | [email protected] | http://www.webtide.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.