Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Issue Running web appl from Eclipse ( Apache)
Issue Running web appl from Eclipse ( Apache) [message #182673] Tue, 14 November 2006 08:26 Go to next message
Eclipse User
Originally posted by: fred_faria.yahoo.com.br

Hi,

I am NOT able to run a web appl from Eclipse gui.
I have followed the example from WTP tutorial;
I am able to create a new server ( Apache Tom Cat ) and start it from
Eclipse tool. I am able too to link a web project to the server.
Everything looks to work fine.
However when I try to run the appl inside the Eclipse I get an error
because the jsp page doesnt exist in webapp DIR. It looks that the web app
files were not copied to Tomcat webapp tool.
When I linked the web project to the server should not these files had
been updated in Tomcat web app dir ?

Regards,
Faria
Re: Issue Running web appl from Eclipse ( Apache) [message #182681 is a reply to message #182673] Tue, 14 November 2006 08:51 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1305
Registered: July 2009
Senior Member
Yes, it should updates the Tomcat webapp dir, but by default, this would
be the one under ".metadata/.plugins/org.eclipse.wst.server.core/tmp?"
under your Eclipse workspace. It this where you are looking?

Cheers,
Larry

Fred wrote:
> Hi,
>
> I am NOT able to run a web appl from Eclipse gui.
> I have followed the example from WTP tutorial; I am able to create a new
> server ( Apache Tom Cat ) and start it from Eclipse tool. I am able too
> to link a web project to the server. Everything looks to work fine.
> However when I try to run the appl inside the Eclipse I get an error
> because the jsp page doesnt exist in webapp DIR. It looks that the web
> app files were not copied to Tomcat webapp tool.
> When I linked the web project to the server should not these files had
> been updated in Tomcat web app dir ?
>
> Regards,
> Faria
>
Re: Issue Running web appl from Eclipse ( Apache) [message #182695 is a reply to message #182681] Tue, 14 November 2006 10:24 Go to previous messageGo to next message
Eclipse User
Originally posted by: fred_faria.yahoo.com.br

Hi Larry,

Yes! I can find the jsp page over the default path
".metadata/.plugins/org.eclipse.wst.server.core/tmp0".
Does it mean that should the sample to be already working fine ?
Or do I need manually to publish for the righ directory ( webapps of
Tomcat install dir ) ?

Best regards,
Fred

------------------------------------------------------------ -------------
Error output:

type Status report

message /Servlets-Tutorial/WEB-INF/main.jsp

description The requested resource (/Servlets-Tutorial/WEB-INF/main.jsp)
is not available.


------------------------------------------------------------ --------------------
Re: Issue Running web appl from Eclipse ( Apache) [message #182726 is a reply to message #182695] Tue, 14 November 2006 11:27 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1305
Registered: July 2009
Senior Member
Hi Fred,

Are you trying to access "/Servlets-Tutorial/WEB-INF/main.jsp" from your
browser? If so, this is the expected behavior. The servlet spec
forbids direct browser access to the contents of the WEB-INF and
META-INF folders. However, internal servlets and JSP pages can forward
or include JSPs under WEB-INF. Add a JSP page under the WebContent
folder that contains "<jsp:forward page="/WEB-INF/main.jsp"/>" and
displaying it in your browser will display the output from main.jsp.

Larry

Fred wrote:
> Hi Larry,
>
> Yes! I can find the jsp page over the default path
> ".metadata/.plugins/org.eclipse.wst.server.core/tmp0". Does it mean that
> should the sample to be already working fine ? Or do I need manually to
> publish for the righ directory ( webapps of Tomcat install dir ) ?
> Best regards,
> Fred
>
> ------------------------------------------------------------ -------------
> Error output:
>
> type Status report
>
> message /Servlets-Tutorial/WEB-INF/main.jsp
>
> description The requested resource (/Servlets-Tutorial/WEB-INF/main.jsp)
> is not available.
>
>
> ------------------------------------------------------------ --------------------
>
>
>
>
Re: Issue Running web appl from Eclipse ( Apache) [message #182733 is a reply to message #182726] Tue, 14 November 2006 13:23 Go to previous messageGo to next message
Eclipse User
Originally posted by: fred_faria.yahoo.com.br

Hi Larry,

Thank you very much for your help.
Right now, it is working fine!! I really had created the main.jsp file
in wrong location diferently that one that Eclipse WTP Tutorial taught.
( I am a beginner for Eclipse and J2EE. ).

Fred.
Re: Issue Running web appl from Eclipse ( Apache) [message #182742 is a reply to message #182733] Tue, 14 November 2006 13:44 Go to previous message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1305
Registered: July 2009
Senior Member
Though a mistake for your main.jsp, putting JSPs in WEB-INF (or a
subfolder) is not necessarily wrong. Often a JSP is used a "viewer" and
requires some session setup, typically by a servlet, before being
invoked on a request. Putting such a JSP in WEB-INF is a convenient way
to prevent users from accessing the JSP directly and having it
malfunction without the setup.

Cheers,
Larry

Fred wrote:
> Hi Larry,
>
> Thank you very much for your help. Right now, it is working fine!! I
> really had created the main.jsp file in wrong location diferently that
> one that Eclipse WTP Tutorial taught.
> ( I am a beginner for Eclipse and J2EE. ).
>
> Fred.
>
Previous Topic:jboss-web.xml and Xdoclet
Next Topic:Using java library project in dynamic web project.
Goto Forum:
  


Current Time: Thu Aug 28 11:34:26 EDT 2014

Powered by FUDForum. Page generated in 0.10906 seconds