New To java/JSP

I am new to JAVA/JSP. I downloaded and installed tomcat. When I try to start it I am getting an error. (java.exe has encountered a problem and needs to close.) It will not start. I am running on Windows-xp. Anyone has any ideas as to what the problem could be ? Do I need to do anything special for Windows-xp ?
Thanks for your help.
- Madan

Your description is not very detailed but I'm using Tomcat quite well to run my JSP/Beans stuff which I'm progressing in learning.
Tomcat is actually "jakarta-tomcat-4.1.18", and to start the server I use d:\jakarta-tomcat-4.1.18\bin\startup.bat
You need to set up various classpath and directory info in setclasspath.bat
Assuming you then get the thing started, to test it out, go to
http://localhost:8080/index.jsp (unless you changed 'localhost')
Please post more questions if you want - I'm sure someone can help.
Gary

Similar Messages

  • Java-JSP working with packages and classes

    Hi everybody,
    I'm bearly new on Java-JSP developping and I wanted to know how Tomcat (for example) manage the imported packages and classes.
    The fact is I'm working on a project ('/bob') which use some packages that I don't see in the '/bob' directory. So, is that possible that '/bob' is downloading packages and classes from Internet to '/bob/download' virtual repertory and use it? If it is true, is it possible to override this download by making '/bob' project using local packages or classes (example : com.boblibrary.classes.util in '/bob/WEB-INF/classes/com/boblibrary/classes/util') instead of downloading it?
    Therefore, the '/bob' project is using bugged classes (that I think it downloads from Internet) which I can't correct.
    Thanks for your help.
    - Renaud

    Thank you for your answer, but I can't imagine where is physicaly the class that my project use and show me as http://localhost:8080/atlassian-jira-3.13.2/download/ressources/br.com.ecore.jira.plugin.projectViewPlugin:ProjectViewTabPanel/js/projectviewtabpanel.js. Where is that Javascript file suppose to be on my hard drive? Or where is that class 'br.com.ecore.jira.plugin.projectViewPlugin' suppose to be on my hard drive? If it is not dowloaded from the Internet.
    I have no trace of that class on 'atlassian-jira-3.13.2/', neither on 'jdk1.6.0_18/', 'jre6/' or 'apache-tomcat-5.5.28/common/classes/'.
    Thanks.

  • How to print new line in jsp page

    hi
    how to print new line in jsp page
    thanks

    \n - new line character is in java specific not HTML
    specific.Well, if the correct line separator sequence (by far not always \n) would be used, it does add a new line to the HTML output. Too bad that you don't want to see HTML but formatted text. The BR tag is a formatting element for the displayed text, not a line break in HTML. ;)

  • In java/jsp got Error,ORA-01000: maximum open cursors exceeded,

    Dear ALL,
    We are facing a problem of in java/jsp. ORA-01000: maximum open cursors exceeded,We are using referance Cursor for returing the Record in java file.
    The Code is given below.
    import java.sql.*;
    import javax.sql.*;
    import com.india.trade.dbConnection.*;
    import oracle.jdbc.driver.*;
    import java.util.Vector ;
    public class IntRmsActivity
         private static JDBCConnection instance = null;
    private static Connection con = null;
         private static CallableStatement stmt_admin_getadmins = null;
         private static String str_admin_getadmins = "{ call Admin_conf.RMS_ADMIN_GETALLADMINS(?,?) }";
         static
              try
                   instance = new JDBCConnection();
                   con = instance.getConnection();
                   stmt_admin_getadmins = con.prepareCall(str_admin_getadmins);
    }catch(Exception se){se.printStackTrace();}
         public static Vector admin_getAdmins() throws Exception
              checkconnection();
              String message = null;
              Vector v_admins = new Vector();
              ResultSet rs_admins = null;
              stmt_admin_getadmins.registerOutParameter(1 , OracleTypes.CURSOR);
              stmt_admin_getadmins.registerOutParameter(2 , Types.VARCHAR);
              stmt_admin_getadmins.execute();
              message = stmt_admin_getadmins.getString(2);
              System.out.println("message " + message);
              rs_admins = ((OracleCallableStatement)stmt_admin_getadmins).getCursor(1);
              while (rs_admins.next())
                        v_admins.addElement(rs_admins.getString("adminid"));
              rs_admins.close();
              return v_admins;
    CREATE OR REPLACE PACKAGE Admin_conf IS
    TYPE REF_CRSR IS REF CURSOR; /* OUTPUT CURSOR VARIABLE TYPE */
    PROCEDURE RMS_ADMIN_GETALLADMINS(RESULTS OUT REF_CRSR,
                                            OUT_MESSAGE OUT VARCHAR2);
    END Admin_conf;
    CREATE OR REPLACE PACKAGE BODY Admin_conf
    IS
    PROCEDURE RMS_ADMIN_GETALLADMINS(RESULTS OUT REF_CRSR,
                                            OUT_MESSAGE OUT VARCHAR2)
    IS
    l_ref_out_crsr REF_CRSR;
    BEGIN
         OPEN l_ref_out_crsr FOR
         SELECT EXECUTIVE_ID adminid
         FROM MASTER_EXECUTIVE_ID
         ORDER BY EXECUTIVE_ID;
         OUT_MESSAGE := 'ADMIN IDS FETCHED SUCCESSFULLY';
         RESULTS := l_ref_out_crsr;     
    EXCEPTION WHEN OTHERS THEN
              OUT_MESSAGE := 'ERROR ' || SUBSTR(SQLERRM, 1, 60);
    END RMS_ADMIN_GETALLADMINS;
    END Admin_conf;
    Regards
    Ajay Singh Rathod

    Are you actually closing the connections, resultsets in all cases?
    From what you've posted you call
    rs_admins.close();but in that method, you propagate any exceptions that occur out to the caller method, which in turn just prints a stack trace.
    So if an exception occurs before you call the rs_admin.close() the result set will never be closed as the statement won't be reached.
    I'd add a speific exception handling routine to the admin_getAdmins() method and include a finally clause to close the result set in all cases. You can still onthrow the exception if you want.
    cheers
    -steve-

  • Oracle Text and Java (jsp)

    Hi,
    I stored files( pdf,word) in blob column. I created index (INSO_FILTER) and i would like to query the files.
    String sword="test";
    String query = "Select COMPID,CREATED,NAME,CVNUMBER from COMPANYCV" + " where contains(CV,' "+sword+" ') > 0 " ;
    System.out.println(query);
    ResultSet rs = stmt.executeQuery(query);
    works fine i get the compid,date,number and filename of the stored file in the blob column. This info is displayed als a link(url). ie. <A HREF="ShowCv.jsp?NAME=doc1.pdf...... So when the user clicks on it, the appropriate program opens (word,acrobat reader) and the content of the file is shown.
    But i also want to know how many times the word test" is found in each of the documents? How can i do this in java (jsp)?
    And i want to highlight to word that is searched for in the document? Any help on doing this ( examples)? The doc should open in the browswer( html -version) and words
    should be highlighted.
    plz help!
    ps.
    if i use:
    select score(1),NAME,COMPID from COMPANYCV where contains(CV, 'BLOB',1 ) > 0 order by score(1) desc
    i get:
    100,Test2.doc,4
    39,Test1.doc,5
    the score is 39 with Test1.doc! But the word blob is not present in that document. What does the "score" realy mean?
    thx

    ok so far so good. Here is what i did;
    filter-> html
    I created a table filterresult:
    query_id number
    document clob
    in sql:
    begin
    ctx_doc.filter('cvindex', 30, 'filterresult',0,FALSE);
    end;
    so now the word document with pk=30 is stored in de blob column as html.
    in my jsp i call:
    String sql= "SELECT DOCUMENT FROM FILTERRESULT WHERE QUERY_ID=0";
    //System.out.println(sql);
    rs = stmt.executeQuery(sql);
    while(rs.next()){
    clob=((OracleResultSet)rs).getCLOB(1);
    is=clob.getAsciiStream();
    int pos=0;
    int length=0;
    byte[] b = new byte[clob.getChunkSize()];
    while((length=is.read(b))!= -1){
    pos+=length;
    os.write(b);
    and the word document shows up in html in my browser!
    I created another table:
    table highlightresults(
    query_id number
    offset number
    length number
    highlight->
    in sql:
    begin
    ctx_doc.highlight('cvindex', 30, 'steven','highlightresults');
    end;
    i want to highlight the word "steven" in the word doc with pk=30.
    I got no error on excecuting this, but how do i combine the 2 thins: how can i open the filtered word document (html) with the highlights shown in a color??
    plz help!
    also; can someone give me and exampple on how to call these sql statements, like:"begin
    ctx_doc.highlight('cvindex', 30, 'steven','highlightresults');
    end; " in my JSP (java) page!
    thank you

  • Default java / jsp file which gets executed before DAM asset rendering

    Hi,
    I have a requirement to implement access control on DAM assets on the basis of a metadata property (tags).
    Is there a default JAVA / JSP file which gets executed before rendering a DAM asset?
    If yes, how can I override it?
    If no, how can I add a new JSP / JAVA file to be executed before rendering of each DAM asset?
    Thanks in advance,
    Anurag

    Hello Anuran,
    I dont think there is any api which is executed when you rendering any DAM asset on page component because for each type of DAM asset there are different APIs available which you use the render those dam asset like "Image" class to render the image asset.
    Each dam asset also support having different rendition format and if you are interested in that then refer http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/dam/api/DamEvent.Type.html
    Please let me know if you need more information
    Thanks,
    Pawan

  • Pls help, i m totally new to java

    Hi everyone, i m new to java, i have created a page with a textfield and two buttons, can someone tell me how to pass the text that i input in the text field into my database (mysql) when i click the add button (id:addButton) and then how to retrieve a data from a column of my database when i click the show button (id:showButton)?
    my table name is todolist3 and the column in my database is item.
    Thank you very much!!!

    if u are completly new to java, u must at least read some tutorials about java and later, the tutorial of Java Studio Creator, and if u have time, something about jsp.
    i dont want to be rude, but listen my advice, if u want to make your "example" to work, u need to copy the mysql conector into core, this is inside of creator, create a data source to bind your project to mysql table, and the best part, send and receive data from your mysql database.
    any doubt just post again
    Belthazor

  • Java/JSP app to List Directories in a Drop Down

    Hi all! I'm a Java Newbie and have an application that was written in VB / ASP that I need to convert to Java / JSP. The app is relatively simple, however my understanding of Java is even more basic. :(
    Here's what I need... The app needs to be able to read a directory structure on the web server and populated a drop down box on a JSP with the directory names. Then when one of the directories that are in the drop down are selected, the files within that directory are listed as HTML links to the actual files.
    How do I get started?? Any sample code from people who have done this??
    Thanks!
    Teresa

    Basically what you want to do is build a vector of objects that represent directories, and each "directory" object contains a vector of files as an attribute. This is done on the server side in a Servlet.
    Then store all these objects in your session. Dynamically build your dropdown box to have an element for each directory. Use the JavaScript onSelect method to invoke another JSP that takes the number of the element selected, and displays all html links for the number that was passed in from the previous servlet.
    For some about $150 I would write the whole thing for you, but here would be the server side code that builds a recursive directory list.
    import java.io.*;
    import java.util.*;
    public class RecursiveDirectoryList {
         Vector Directories = new Vector();
         Vector Files = new Vector();
    public RecursiveDirectoryList() {
         super();
    public static void main(String[] args) {
    String directoryName; // Directory name entered by the user.
    File directory; // File object referring to the
    //directory.
    //TextIO.put("Enter a directory name: ");
    directoryName = "C:\\docs";
    directory = new File(directoryName);
    if (directory.isDirectory() == false) {
    // Program needs a directory name. Print an error message.
    if (directory.exists() == false)
    System.out.println("There is no such directory!");
    else
    System.out.println("That file is not a directory.");
    else {
    // List the contents of directory, with no indentation
    // at the top level.
    listContents( directory, "" );
    } // end main()
    static void listContents(File dir, String indent) {
    // A recursive subroutine that lists the contents of
    // the directory dir, including the contents of its
    // subdirectories to any level of nesting. It is assumed
    // that dir is in fact a directory. The indent parameter
    // is a string of blanks that is prepended to each item in
    // the listing. It grows in length with each increase in
    // the level of directory nesting.
    String[] files; // List of names of files in the directory.
    System.out.println("Directory: " + dir.getAbsolutePath());
    indent += " "; // Increase the indentation for listing the contents.
    files = dir.list();
    for (int i = 0; i < files.length; i++) {
    // If the file is a directory, list its contents
    // recursively. Otherwise, just print its name.
    File f = new File(dir, files);
    if (f.isDirectory())
    listContents(f, indent);
    else
    System.out.println("File: " + dir.getAbsolutePath() + "\\" + files[i]);
    } // end listContents()

  • New to Java - problem with form with DB connectivity

    Hi
    i'm new to java. And i have designed one HTML form which is having the following fields name,email, date(i used drop down box for this dd/mm/yy) and comments. Now i want to insert these data into Database. I'm using MS Access DB. I dont know how to connect and retrive data from DB. Any can help and guide me? Its very urgent. And also want to know the purpose of using JSP, SERVLETS and JDBC.
    Regards,
    Prabu

    You can start with these links:
    [1] http://java.sun.com/products/servlet/
    [2] http://java.sun.com/products/jsp/
    [3] http://java.sun.com/javaee/5/docs/tutorial/doc/
    [4] http://java.sun.com/docs/books/tutorial/jdbc/
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    ----------------------------------------------------------------

  • Help a new guys with JSP!

    Hi,
    i'm a new programer with JSP.
    I've created a class files that connect a database.
    But i would like to know how to write text with JSP?
    I would like to write a 'thank you' message after saving a form in a database.
    does its possible to have it in my class files?
    thanks for your help.

    Im not an expert on jsp or java but i will try to give my ideas.. i hope i can help you =)
    /* you could actually forward your servlet to your confirmation file like this : */
              ServletContext sc = getServletContext();
    .// just fill up here the variable msg , u cud write to its value your thank you message or something else like error messages
              RequestDispatcher rd = sc.getRequestDispatcher("/Confirmation.jsp?msg="+msg);          
              rd.forward(req, res);     
    /******* or u cud also throw ur request to the same jsp and display the ***/
    /******* message thru a form tag using javascript like this : ***/
    suppose your main jsp is this:
    <html>
    <head>
    <STYLE TYPE="text/css">
         .noBorder{
              border: white 0px solid;
              background-color: white;
              font-family:Arial;
              font-size:13px;
              font-weight: bold;
              color:green;
              width:300px;
              text-align:center;
    </STYLE>
    </head>
    <%!
    Connection conn;
    PreparedStatement pstmt;
    private doInsert(String name){
    // this is an oracle connection
    String sql = "INSERT INTO TABLENAME(FIELD1) VALUES(?)"
    try{     
    Class.forName("oracle.jdbc.driver.OracleDriver");
    // just fill up the dburl , dnusername and dbpassword
    conn = DriverManager.getConnection(dburl,dbusername,dbpassword);
    pstmt = conn.prepareStatement(sql);
    pstmt.clearParameters(); // clear any previous parameter values
    pstmt.setString(1,name);
    pstmt.close();
    }catch(SQLException se){     
    }catch(Exception e){          
    }finally{
    if(conn!=null){
         try{
         conn.close();
         }catch(SQLException se){}
    %>
    <body>
    <form method=post"" name="msgscr">
    <tr><td colspan="2"><input type="text" name="msg" value="" class="noBorder" disabled/></td></tr>
    </form>
    <%
    if(request.getParamater("submit")!=null){
    // you could also add a return value for doInsert method to check whether the dbase insertion
    // is successful or not if the return value is true then the value for the document.msgscr.msg.value
    // is thank you otherwise u cud put "Unable to process your request" or other message
    doInsert(request.getParameter("name"));
    out.println("<script>document.msgscr.msg.value='Thanks you!!!!';</script>")
    %>
    <!-- this means that the request qill be thrown on this file-->
    <form method="post">
    <tr>
    <td>NAme : </td>
    <td><input type="text" name="name" value=""/></td>
    </tr>
    <tr><td colspan="2" align="center"><input type="submit" name="submit " value="Submit"></td></tr>
    </form>
    </body>
    </html>     
    /**** or you could also do the confirmation message just by adding an **/
    /**** alert message using javascript like this: **/
    <head>
    <script language="javascript">
    function ValidateCreate(theform){
         if(theform.name.value==""){
         alert("name is required");
         return false;
         }else{
         alert("Thank you!!!!");
    return true;
    </script>
    </head>
    <body>
    <form method="post" onsubmit="return ValidateCreate(this)">
    <tr>
    <td>NAme : </td>
    <td><input type="text" name="name" value=""/></td>
    </tr>
    <tr><td colspan="2" align="center"><input type="submit" name="submit " value="Submit"></td></tr>
    </form>

  • Hi I'm new to java

    Hi,
    When i tried to run the Servlet it is showing the following warning:
    "serializable class ProfileServlet doesn't declare a static final serialversionUID field of type long"
    ProfileServlet.java
    package flowers;
    import java.io.IOException;
    import java.io.*;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class ProfileServlet extends HttpServlet{
    public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
              defaultAction(request,response);
    public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
              defaultAction(request,response);
    public void defaultAction(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
              String name=request.getParameter("UserID");
              String pwd=request.getParameter("PassWord");
              response.setContentType("text/html");
              PrintWriter out=response.getWriter();
              out.println("<html><head><title>Form Data Processing</title></head></html>");
              out.println("<body>");
              out.println("<h1>Welcome<h1>");
              out.println("<hr>");
                        out.println("<h3>Name is:"+name+"</h3></body></html>");
                        out.println("<h3>PassWord is:"+pwd+"</h3></body></html>");
              out.println("<hr>");          
    ProfilePage.html
    <p><HTML></p>
    <p><HEAD></p>
    <p><TITLE>ProfilePage.html</HTML></p>
    <p></HEAD></p>
    <p><BODY></p>
    <p><FORM Action="http://localost:9080/BeautifulFlowers/ProfileServlet" Method="POST"></p>
    <p>UserID:<INPUT TYPE="TEXT" NAME="UserID"><br></p>
    <p>PassWord:<INPUT TYPE="TEXT" NAME="PassWord"><br></p>
    <p><center></p><p><input type="submit" value="submit"
    size="16"></p>
    <p><input type="reset" value="reset" size="16"></p><p></center></p><p></FORM></p>
    <p></BODY></p>
    <p></HTML></p>
    <p></p>
    <p></p>
    Please help me with this

    duffymo wrote:
    Terrible code, by the way. Yours is an example of how not to write good servlets. You're new to Java, so it can be excused. If you're new, why start with a servlet? Most people begin with "Hello, world". Are you already beyond that?I don't know the story with this newbie, but there are just too many instructors that must be introducing Java in heinous ways, like via scriptlets stuck in JSP. It used to be the misconception that Java was mainly for writing applets; now the misconception is that it's mainly for scriptlets.
    It's gotten to the point that I don't want to look at any posted question about JSP or servlets. I know the code will be so bad that only first advice is to start over, but the only thing the poster wants to hear is how to hack their code further.

  • Plz help me I'm new to java

    I've created simple data base in sql and a simple html page,here is the code:
    <%@ page import="java.util.*" import="java.sql.*" %>
    <%!
    private String emp_code, emp_name, emp_dept, emp_title, emp_doj, emp_dob;
    private String error, info, create;
    private short age;
    private Statement stmt;
    %>
    <%
    //load the JDBC driver
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn = DriverManager.getConnection("jdbc:odbc:Master","","");
    Statement s = conn.createStatement();
    s.executeUpdate("insert into employee_info values('" + emp_code + "', '" + emp_name + "','" + emp_dept + "','" + emp_title + "', '" + emp_doj + "','" + emp_dob + "') ");
    System.out.println ("It has been successfully added");
    %>
    <HTML>
    <HEAD>
         <TITLE> ---: New Employee Information :--- </TITLE>
    </HEAD>
    <BODY>
    <DIV ALIGN="center">
         <H2> New Employee Information </H2></DIV>
    <DIV ALIGN="center">
         <p> � </p></DIV>
         <FORM METHOD = "POST" ACTION = "NewEmp.jsp">
    <H4>Employee Code: <INPUT TYPE= "text" NAME = "first1" SIZE = "17">����
    Name: <INPUT TYPE = "TEXT" NAME = "first" SIZE = "51">�������
    <font size="3">Title:�<SELECT name="Grade">
    <OPTION SELECTED> - Select -
    <OPTION >Programmer
    <OPTION >Technetion
    <OPTION>System Analyst
    <OPTION>Network Administrator
    </SELECT>�</font>
              </H4>
    <H4><font size="3">�</font>
              </H4>
    <H4><font size="3">Department Code:�</font><select name="Dept">
    <OPTION SELECTED> - Select -
    <OPTION >IT
    <OPTION >Admin
    <OPTION>MGM
    <OPTION>CSD
    <OPTION>SM
    <OPTION>FIN
    </SELECT>
    ��������
    <font size="3"><b>DOB: </b> </font> <INPUT TYPE = "TEXT" NAME = "first2" SIZE = "18">������
    <b><font size="3">DOJ: </font></b><INPUT TYPE = "TEXT" NAME = "first3" SIZE = "18">
              </H4>
    <p>�
              </p>
    <P align="center">
    <INPUT TYPE = "SUBMIT" VALUE = "Submit">     
    <INPUT TYPE = "RESET">
    <input type="button" value="Cancel" name="Cancel" onClick='javascript:window.close();'> </FORM>
    <p align="center">�</p>
    </BODY>
    </HTML>
    But I couldn't complete it or make the connection to the database, I want to fill in the blanks and then add it to the data base.
    My database name is doctrak and the table name is employee_info and below the design of the table :
    emp_code     char     10
    emp_name char     30     
    emp_dept     char     15     
    emp_title     char     10     
    emp_doj     datetime     8     
    emp_dob     datetime     8     
    I've installed the apatchi tomcat 401 and make the java environment.
    So plz can any one help me in that?
    Thanks

    But I don't know how to handel the code, I didn't
    study JSP or Java. I'm trying to learn it by doing
    this, so please can you write the code for me in jsp
    and how to put it in html then , how to do the
    connection to my database?Iam sorry to disappoint you, but no.
    If you are new to java and jsp taking up such a task to learn it is not ideal, nor
    viable. I would suggest you learn the basics of the language first, then the basics
    of jsp, then some jdbc and finally graduate to the example in question. There are
    excellent tutorials avbl for all on the net.
    Maybe someone else would even post the code here, but suggest you dont
    waste time waiting on it.
    All the best.
    Cheers,
    ram.

  • New to Java EE 5

    hi everyone,
    i'm totally new to Java EE...i had used J2SE before to develop desktop applications (and with Swing for GUI too)...and i also used J2SE along with Tomcat to develop some simple web development...
    now i'm going to get into a bigger Java web development project...and i would like to know more about Java EE and other technologies surrounding it...it'd be great if some of you can help =)
    1) do i need Java EE instead of Java SE for web development? i ask because before i did some simple JSP/Servlet stuff with only J2SE SDK and Tomcat...
    2) what is the purpose of Glassfish? i read that it is an application server...what is an application server for? what is the purpose of Glassfish over Java EE SDK/JRE?
    3) for web development in Java, which IDE should i use? Eclipse or NetBeans? what are their pros and cons?
    4) i know in these years, there are several popular java frameworks for web development such as Struts, Spring, etc...now for Java EE 5, what would be a good framework to use? Would JSF be the right direction to go as it is a framework from Sun?
    hmm...i still have a lot more questions....but i'll limit the number of questions in this post...
    thank you for your time and information!! =)

    1) do i need Java EE instead of Java SE for web
    development? i ask because before i did somesimple
    JSP/Servlet stuff with only J2SE SDK and Tomcat...You need Java EE with Java SE, not instead. you mean i need both of them installed? what is the procedure? like if i go to the following link for the SDK of Java EE 5...i still need to go to download SE and install it?
    http://java.sun.com/javaee/downloads/index.jsp
    >
    Tomcat is a web container and it has the
    implementation of the servletjsp classes which are
    available in EE.
    2) what is the purpose of Glassfish? i read thatit
    is an application server...what is an application
    server for? what is the purpose of Glassfish over
    Java EE SDK/JRE?Glassfish is an application server which is used for
    web applications (web container) as well as
    enterprise components like EJB.so Glassfish is a counterpart of Tomcat? like i can use Glassfish instead of Tomcat? how about Apache? i have been using Apache as the web server whilte Tomcat being the app server...how does Glassfish integrate with Apache? or what web server should i use with Glassfish?
    >
    3) for web development in Java, which IDE should i
    use? Eclipse or NetBeans? what are their pros and
    cons?If you are going to use Glassfish, Netbeans would be
    a better choice because it integrates well. For all
    other application servers, I prefer Eclipse because I
    don't know how to configure Netbeans and I have been
    using Eclipse for a long time. The choice of IDE is
    more of personal ease of use rather than actual
    feature comparison.i don't know whether i should use Glassfish...it seems to me that it is expanding...and as i only had very little experience with Tomcat...switching to Glassfish would not be a waste of extra time for me...should i go with Glassfish then? or Tomcat is still considered more stable/reliable/compatible?
    also...if Eclipse is good in other stuff...is it a good idea to find out more about Eclipse's support to Glassfish instead of going for NetBeans?
    >
    4) i know in these years, there are severalpopular
    java frameworks for web development such asStruts,
    Spring, etc...now for Java EE 5, what would be agood
    framework to use? Would JSF be the right directionto
    go as it is a framework from Sun?I haven't ever used JSF to comment on that but I
    would suggest that you use Spring for good and clean
    development.i understand this...as JSF is still quite new and developers have been using Struts and Spring forever...

  • New to java needs advice

    Hi,
    I'm completely new to java and after a few days search found Studio Creator and decided to use it. Happily developing for a week in JSC, I reached the deployment to Tomcat stage.
    Mybe I'm missing something but I find this stage ruining the ease-of-use feeling which I got when I started using JSC.
    Am I right that JSC doesn't have a built-in functionality to deploy to Tomcat whithout my intervention, considering my total unfamiliarity with xml, jsp, mysql, etc.?
    If so do you guys know of another easy-to-use IDE like JSC?
    Any pointers are greatly appreciated.
    Thanks, Abraham

    Hi,
    Try this FAQ on
    How do I deploy web applications developed with Java Studio Creator to the Tomcat Servlet/JSP Container?
    at http://developers.sun.com/prodtech/javatools/jscreator/reference/faqs/technical.jsp
    MJ

  • How can I open help file (HTML or .chm) from Java Web Start (new to JAVA)

    Hi All,
    Im trying to open the help file of my application.
    When trying to access the help file from the GUI (pressing F1 for launching the help file), I'm geting the an error, something like:
    "Can't show help URL: jar:file:C:\Documents and Settings\%USER%\Application Data\Sun\Java\Deployment\javaws\cache\http\Dlocalhost\P7001\DMwebstart\RMjar-name!/com/resources/helpFiles/MyHelpFile.html"
    It seems that the file which is packed in a jar, was downloaded to the Java Web Start cache directory:
    C:\Documents and Settings\%USER%\Application Data\Sun\Java\Deployment\javaws\cache\http\Dlocalhost\P7001\DMwebstart
    The code which is activated when launching the help file is:
    try
                ResourceBundle resourceBundle = DoubleResourceBundle.getBundle("Resource", "ResourceImpl");
                RuntimeUtil.launchFile(new File(resourceBundle.getString("help.file")));
            } catch (IOException e)
                // TODO Auto-generated catch block
                e.printStackTrace();
            }where the property "help.file" is in some property file in the resource bundle named "Resource", and looks like this :
    help.file="com/trax/docs/help/global/MyHelpFile.html"
    The function "RuntimeUtil.launchFile" knows how to launch any file in its default application, and indeed it does launches the html, when giving it an absolute path to the file on my PC, as "C:\Helpfiles\MyHelpFile.html" as such:
    RuntimeUtil.launchFile("C:\Helpfiles\MyHelpFile.html");My question is :
    The application is going to be deployed on a Customer PC. How can I access the html file from the code, with a relative path and not its absolute path on the customer pc, which I can't know?
    I found these restrictions regarding web start:
    (copied from "http://rachel.sourceforge.net/"):
    *Rule 1: Java Archives only. No loose files.* All your resources have to be packaged in Java Archives (jar) if you want to have
    them delivered to the user's machine and kept up-to-date automatically by Java Web Start.
    *Rule 2: No file paths.* You can't use absolute or relative file paths to locate your
    jars holding your resources (e.g. <code>jar:file:///c:/java/jws/.cache/resources.jar</code>).
    Absolute file paths won't work because you never know where Java Web Start
    will put your jar on the user's machine. Relative file paths won't work because Java Web Start
    mangles the names of your jars (e.g. <code>venus.jar</code> becomes <code>RMvenus.jar</code>)
    and every JNLP client implementation has the right to mangle your names
    in a different way and you, therefore, can't predict the name with
    which your jar will be rechristend and end up on the user's machine in
    the application cache.Seems complex or impossible, to perform a simple task like opening a file.
    Please advise (I'm new to Java and Web Start).
    BTW, I'm working with IntelliJ IDEA 5.0.
    Thanks,
    Zedik.
    {font:Tahoma}{size:26pt}
    {size}{font}

    the follwing method i have used to open html file ...
    so to access html file i am shipping resources folder with jar file ..
    private void openHtmlPages(String pageName) {
         String cmd[] = new String[2];
         String browser = null;
         File file = null;
         if(System.getProperty("os.name").indexOf("Linux")>-1) {
              file = new File("/usr/bin/mozilla");
              if(!file.exists() ) {
              }else     {
                   browser = "mozilla";
         }else {
              browser = "<path of iexplore>";
         cmd[0] = browser;
         File files = new File("");
         String metaData = "/resources/Help/Files/"+pageName+".html"; // folder inside jar file
         java.net.URL url = this.getClass().getResource(metaData);
         String fileName = url.getFile();
         fileName = fileName.replaceAll("file:/","");
         fileName = fileName.replaceAll("%2520"," ");
         fileName = fileName.replaceAll("%20"," ");
         fileName = fileName.replaceAll("jarfilename.jar!"," ").trim();
         cmd[1] = fileName;     
         try{
              Process p = Runtime.getRuntime().exec(cmd);
         }catch(java.io.IOException io){
                   //Ignore
    can anyone give me the solution..???
    Regards
    Ganesan S

Maybe you are looking for