• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

deploying and running web application in the home pc

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


i am reading "HEAD FIRST Servlets and JSP" book.I have tomcat,JDK1.5,eclipse softwares installed in my machine.Can anyone please tell me how to configure those an to try the examples given in that book.


 
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vidya,

where do you stuck up ? using tools in eclipse ? if so there are plenty of tutorials available online. here is one.


Search like " eclipse tutorial to create web projects" , will land you there.
 
Vidya Bhargavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,



i have tomcat,JDK and eclipse.Please tell me how to set the environment variables,classpath ecc...so that i can be able to run the web application in eclipse. Give me the steps for that please.
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Isn't that link posted dint help you. There is no requirement to explicitly set any env variables and classpath . Its taken care by eclipse itself when creating a new "web project" . You can add your jars (like jdbc driver jar ) in Project --> BuildPath.

Here are rough steps.
1) Configure your JDK/JRE to Eclipse
2) Add your Tomcat server to Eclipse ( this depends on eclipse version - Ganymede has inbuilt plugin )
3) Create a new web project

Check this link again. Its the basic setup that is explained clearly.

http://www.eclipse.org/webtools/community/tutorials/BuildJ2EEWebApp/BuildJ2EEWebApp.html
 
Vidya Bhargavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


Please Check the attachment.I am using Easy Eclipse.There is no "server" option in preferences.Can anyone Please help me how to proceed with it as i got to run the web applications of "head first-jsp and servlets" book.
preferences.jpg
[Thumbnail for preferences.jpg]
window->preferences in eclipse
 
Vidya Bhargavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


Anyone please reply for the above mail...I'ts urgent.........
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vidya,

Eclipse Ganymede and future releases has this "Server" option. Since you are using Easy Eclipse ,check in easy eclipse site to configure servers . Here are the links i found which should help you.

http://www.easyeclipse.org/site/plugins/tomcat-launcher.html
http://www.easyeclipse.org/site/distributions/server-java.html
 
Vidya Bhargavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,


thank you so much.....it was useful...


i have a list of questions.....

please answer me those...

1)what is the purpose of java.io.serializable marker interface?is it used anywhere in EJB?

2)which is better to use?Iterator or Enumerator?


3)in try block is it possible to throw an exception?
 
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1)what is the purpose of java.io.serializable marker interface?is it used anywhere in EJB?

answer: yes

2)which is better to use?Iterator or Enumerator?
Answer:depending on need
Enumeration deals with objects while iteration deals with values only. Enumeration is used when we use vector hashtable etc while iteration are used in while loop for loop etc



3)in try block is it possible to throw an exception?
answer: yes
A exception is thrown by using the throw keyword from inside the try block
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vidya Bhargavi wrote:3)in try block is it possible to throw an exception?


Its more likely you will do it in real applications, for e.g.
 
Vidya Bhargavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,


thank you so much for the answers.......

I want to know exactly what is the purpose of marker interface and how it is used in EJB?
 
Vidya Bhargavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,


I also want to know can i install weblogic 8.1 in my home pc and practise EJB applications?
 
Vidya Bhargavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,


what is the difference between the servlet container and the EJB container?
 
mark benz
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I want to know exactly what is the purpose of marker interface


A Marker interface is an interface with no methods or fields; it is generally used to "mark" a class for certain behavior.

java.io.Serializable is an example of a marker interface; that said "objects of my implementing class can be serialized, deserialized".
 
Vidya Bhargavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi,


1)can i install weblogic 8.1 in my home pc and practise EJB applications?


2)what is the difference between servlet container and EJB container?


Kindly Please answer me the above questions.Its urgent.........
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vidya,
Please use standard text formats , others are irritating to see.

1)can i install weblogic 8.1 in my home pc and practise EJB applications?

Yes. infact you can try to download 10.3. Under OTN agreement , it should be used only for practising and not for marakatable applications.

2) what is the difference between servlet container and EJB container?
You can search this forum for previously answered questions.
 
Vidya Bhargavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


Thank You so much...


sorry for the font size which i used before....
 
Vidya Bhargavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,


i am able to run the tomcat server in the eclipse console.Can anyone please tell me the steps to run a simple web application.i have servlet.java and web.xml files....
 
Vidya Bhargavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,


Please reply for the above post...its important and urgent.....
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vidya,
I have already sent you link pointing to simple web app examples. what else do you expect.. after 10 replies you still ask the same question.
 
Vidya Bhargavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

sorry if i am asking 10 times......

servlet:

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class servlet1 extends HttpServlet
{
public void doGet(HttpServletRequest request,HttpServletResponse response)throws IOException
{
PrintWriter out=response.getWriter();
java.util.Date today=new java.util.Date();
out.println("<html>"+"<body>"+"<h1 align=center>Chapter 1 Servlet</h1>"+"<br>"+today + "</body>"+"</html>");
}
}

web.xml:
- <web-app>
- <servlet>
<servlet-name>Chapter 1 Servlet</servlet-name>
<servlet-class>servlet1</servlet-class>
</servlet>
- <servlet-mapping>
<servlet-name>Chapter 1 Servlet</servlet-name>
<servlet-class>/Serv1</servlet-class>
</servlet-mapping>
</web-app>

the above are the codings which i am trying to run.....


in my eclipse there is no j2ee project wizard....

so i selected tomact project wizard...

i have attached the screen shot for eclipse also...

now please tell me how to proceed to run the application in the browser....
servlet1.JPG
[Thumbnail for servlet1.JPG]
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

in my eclipse there is no j2ee project wizard....



If it does not support , then you cannot run servlets. JEE projects should be run in JEE perspective. Download the JEE supported Eclipse as its is available in different flavours. If you still like to use Easy Eclipse , check in thier site on JEE supported one.

Here is the Eclipse Ganymede flavours which i use. The link for JEE developers is the first one.
 
Vidya Bhargavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,


I have 2 questions.Please tell me the answers for those.

1)for eg:

abstract class vidya
{
void coding();
}

The above code is valid if we use or do not use the keyword abstract in the class....Then can you please tell me why " abstract" is used there.

2)Please tell me where do we use throw,throws with examples in exception handling?
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vidya,
Please open a new thread in appropriate forum for questions which does not suit the IDE forum.

Probably in Beginning Java to get more responses.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic