You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lava Saleem <ln...@ualr.edu> on 2010/12/06 16:07:44 UTC

war file question

Hi Everyone,
I have an html file with java script embedded in it, I want to employ this
web page in the apache tomcat, can you please give me hints on how to
transfer this file into war file, I have the file in the right directory
inside the WEB-INF but it is not working, do I need to convert this file
into JSP then to war file ? I'm getting the following message

FAIL - Application at context path /handshake_testing could not be started

Thank you in advance for the feedback



Lava

Re: war file question

Posted by Pid <pi...@pidster.com>.
On 12/6/10 3:48 PM, Lava Saleem wrote:
> Hi Martin,
> Thanks for the reply  I did what you told me I moved the html file into
> $TOMCAT_HOME/webapps/filename    and changed to *.jsp but it didn't work I
> got the following message
> 
> FAIL - File uploaded "handshake_testing.jsp" must be a .war

Start here:

 http://tomcat.apache.org/tomcat-6.0-doc/appdev/index.html


p

Re: war file question

Posted by Victor Kabdebon <vi...@gmail.com>.
Hi,

May I add something Lava, if you don't want to work around war manually use
Netbeans or Eclipse as your IDE and they can do it for you without any
effort.

Victor Kabdebon

2010/12/6 Konstantin Kolinko <kn...@gmail.com>

> 2010/12/6 Lava Saleem <ln...@ualr.edu>:
> > Hi
> > Thanks for the replies
> > Pid thanks for the link but I have looked into before sending the email
> and
> > it is very general and not very useful, as I'm a beginner user for
> tomcat.
> > Check I was deploying the  file with jsp extension  and I got this
> > message on the top of the tomcat webpage. Now I have my html file in the
> > WEB-INF  I changed the extension to war but that didn't work as it didn't
> > work if I left it as html extension. it is very simple file with few
> lines
> > of java script.
> > Thanks
>
> 1. WAR is effectively a zip archive. You create one using the "jar"
> archiver program in the JDK.
>
> http://download.oracle.com/javase/6/docs/technotes/tools/windows/jar.html
>
> That is: you have to prepare the files for your web application and
> then "zip" them with the jar utility.
>
> E.g. for the examples webapp that comes with Tomcat:
> 1) go to
>  $CATALINA_BASE/webapps
> 2) run
>  jar -cf examples.war -C examples .
>
> it will pack the "examples" directory into a war file.
>
>
> 2. The WEB-INF and META-INF subdirectories are special. They are not
> "visible" from the outside. So, you should not put your .html, or .js,
> or .css or images there.
>
> The WEB-INF directory is for configuration (the web.xml file is the
> main one there) and for executable code.
>
> You should place your web page elsewhere. Usually - at the root of your
> webapp.
>
> See the ROOT application that comes with Tomcat, You will find an
> index.html there.
>
> (ROOT is the special name for the default webapp on Tomcat).
>
>
> 3. There should be tutorials for beginners somewhere. (One is that Pid
> mentioned).
>
> You should really go step-by-step with a one of them once.
>
> The links to the official specifications can be found here:
> http://wiki.apache.org/tomcat/Specifications
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: war file question

Posted by Konstantin Kolinko <kn...@gmail.com>.
2010/12/6 Lava Saleem <ln...@ualr.edu>:
> Hi
> Thanks for the replies
> Pid thanks for the link but I have looked into before sending the email and
> it is very general and not very useful, as I'm a beginner user for tomcat.
> Check I was deploying the  file with jsp extension  and I got this
> message on the top of the tomcat webpage. Now I have my html file in the
> WEB-INF  I changed the extension to war but that didn't work as it didn't
> work if I left it as html extension. it is very simple file with few lines
> of java script.
> Thanks

1. WAR is effectively a zip archive. You create one using the "jar"
archiver program in the JDK.

http://download.oracle.com/javase/6/docs/technotes/tools/windows/jar.html

That is: you have to prepare the files for your web application and
then "zip" them with the jar utility.

E.g. for the examples webapp that comes with Tomcat:
1) go to
 $CATALINA_BASE/webapps
2) run
 jar -cf examples.war -C examples .

it will pack the "examples" directory into a war file.


2. The WEB-INF and META-INF subdirectories are special. They are not
"visible" from the outside. So, you should not put your .html, or .js,
or .css or images there.

The WEB-INF directory is for configuration (the web.xml file is the
main one there) and for executable code.

You should place your web page elsewhere. Usually - at the root of your webapp.

See the ROOT application that comes with Tomcat, You will find an
index.html there.

(ROOT is the special name for the default webapp on Tomcat).


3. There should be tutorials for beginners somewhere. (One is that Pid
mentioned).

You should really go step-by-step with a one of them once.

The links to the official specifications can be found here:
http://wiki.apache.org/tomcat/Specifications

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: war file question

Posted by Pid <pi...@pidster.com>.
On 12/6/10 6:30 PM, Lava Saleem wrote:
> Hi
> Thanks for the replies
> Pid thanks for the link but I have looked into before sending the email and
> it is very general and not very useful, as I'm a beginner user for tomcat.
> Check I was deploying the  file with jsp extension  and I got this
> message on the top of the tomcat webpage. Now I have my html file in the
> WEB-INF  I changed the extension to war but that didn't work as it didn't
> work if I left it as html extension. it is very simple file with few lines
> of java script.
> Thanks

There are a few misunderstandings here.  A .war file is a type of zip
archive, which contains a web application.

Putting a file in a WEB-INF directory somewhere doesn't automatically
produce a web application.

I sent you the link, because it contains a series of references which
explain what a web application is: it also clearly defines the structure
of an application and how to assemble one.

It is precisely because you are a beginner that it's useful, because it
introduces concepts and gives you an example application to work with.

Maybe you could re-read that section of the site?


p


> On Mon, Dec 6, 2010 at 12:45 PM, Caldarale, Charles R <
> Chuck.Caldarale@unisys.com> wrote:
> 
>>> From: Lava Saleem [mailto:lnsaleem@ualr.edu]
>>> Subject: Re: war file question
>>
>>> Hi Martin,
>>> Thanks for the reply
>>
>> Which, unfortunately, was largely irrelevant, and contained a serious flaw.
>>
>>> I did what you told me I moved the html file into
>>> $TOMCAT_HOME/webapps/filename and changed to *.jsp
>>
>> Moving the file is correct, but don't change the extension - leave it as
>> .html; it's not a JSP.
>>
>>> FAIL - File uploaded "handshake_testing.jsp" must be a .war
>>
>> The above is not a Tomcat message, although it may come from some auxiliary
>> app deployed under Tomcat.  Exactly what were you doing when you got the
>> message?
>>
>>  - Chuck
>>
>>
>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
>> MATERIAL and is thus for use only by the intended recipient. If you received
>> this in error, please contact the sender and delete the e-mail and its
>> attachments from all computers.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 
> 


Re: war file question

Posted by Lava Saleem <ln...@ualr.edu>.
Hi
Thanks for the replies
Pid thanks for the link but I have looked into before sending the email and
it is very general and not very useful, as I'm a beginner user for tomcat.
Check I was deploying the  file with jsp extension  and I got this
message on the top of the tomcat webpage. Now I have my html file in the
WEB-INF  I changed the extension to war but that didn't work as it didn't
work if I left it as html extension. it is very simple file with few lines
of java script.
Thanks



On Mon, Dec 6, 2010 at 12:45 PM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:

> > From: Lava Saleem [mailto:lnsaleem@ualr.edu]
> > Subject: Re: war file question
>
> > Hi Martin,
> > Thanks for the reply
>
> Which, unfortunately, was largely irrelevant, and contained a serious flaw.
>
> > I did what you told me I moved the html file into
> > $TOMCAT_HOME/webapps/filename and changed to *.jsp
>
> Moving the file is correct, but don't change the extension - leave it as
> .html; it's not a JSP.
>
> > FAIL - File uploaded "handshake_testing.jsp" must be a .war
>
> The above is not a Tomcat message, although it may come from some auxiliary
> app deployed under Tomcat.  Exactly what were you doing when you got the
> message?
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Lava Saleem
Ph.D Candidate
Systems Engineering Dept. ETAS 357
University of Arkansas at Little Rock
2801 S University Avenue
Little Rock, AR 72204
Tel: (501) 920 6261
Email: lnsaleem@ualr.edu

RE: war file question

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Lava Saleem [mailto:lnsaleem@ualr.edu] 
> Subject: Re: war file question

> Hi Martin,
> Thanks for the reply

Which, unfortunately, was largely irrelevant, and contained a serious flaw.

> I did what you told me I moved the html file into
> $TOMCAT_HOME/webapps/filename and changed to *.jsp

Moving the file is correct, but don't change the extension - leave it as .html; it's not a JSP.

> FAIL - File uploaded "handshake_testing.jsp" must be a .war

The above is not a Tomcat message, although it may come from some auxiliary app deployed under Tomcat.  Exactly what were you doing when you got the message?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: war file question

Posted by Lava Saleem <ln...@ualr.edu>.
Hi Martin,
Thanks for the reply  I did what you told me I moved the html file into
$TOMCAT_HOME/webapps/filename    and changed to *.jsp but it didn't work I
got the following message

FAIL - File uploaded "handshake_testing.jsp" must be a .war

Lava

On Mon, Dec 6, 2010 at 10:36 AM, Martin Gainty <mg...@hotmail.com> wrote:

>
> most containers will not look for jsp in WEB-INF but in webapp base folder
> e.g. $TOMCAT_HOME/webapps/WebAppFolderName
> to remedy mv/rename the html files from WEB-INF over to WebAppFolderName
> and be sure to mv/rename *.html to *.jsp
>
> Shalom,
> Martin
>
> >
> > Hi Everyone,
> > I have an html file with java script embedded in it, I want to employ
> this
> > web page in the apache tomcat, can you please give me hints on how to
> > transfer this file into war file, I have the file in the right directory
> > inside the WEB-INF but it is not working, do I need to convert this file
> > into JSP then to war file ? I'm getting the following message
> >
> > FAIL - Application at context path /handshake_testing could not be
> started
> >
> > Thank you in advance for the feedback
> >
> >
> >
> > Lava
>
>



-- 
Lava Saleem
Ph.D Candidate
Systems Engineering Dept. ETAS 357
University of Arkansas at Little Rock
2801 S University Avenue
Little Rock, AR 72204
Tel: (501) 920 6261
Email: lnsaleem@ualr.edu

RE: war file question

Posted by Martin Gainty <mg...@hotmail.com>.
most containers will not look for jsp in WEB-INF but in webapp base folder e.g. $TOMCAT_HOME/webapps/WebAppFolderName
to remedy mv/rename the html files from WEB-INF over to WebAppFolderName and be sure to mv/rename *.html to *.jsp

Shalom,
Martin

> 
> Hi Everyone,
> I have an html file with java script embedded in it, I want to employ this
> web page in the apache tomcat, can you please give me hints on how to
> transfer this file into war file, I have the file in the right directory
> inside the WEB-INF but it is not working, do I need to convert this file
> into JSP then to war file ? I'm getting the following message
> 
> FAIL - Application at context path /handshake_testing could not be started
> 
> Thank you in advance for the feedback
> 
> 
> 
> Lava