facebook

how to open a war file and deploy as a seperate project

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #231861 Reply

    Could anyone help in opening a war and deploy it as a seperate project.

    #231866 Reply

    Riyad Kalla
    Member

    WAR’s are typically the “binary” format of your project in that they usually don’t include source code for your classes. Does your WAR contain source code and you just want to convert it into a MyEclipse project?

    #231867 Reply

    I have a war file in c:/test.war . I need to open it in eclipse and deploy it. Could any one help me in this ?

    #231869 Reply

    Riyad Kalla
    Member

    If you would like help please answer my questions. Your last post was a restatement of your first post.

    #231871 Reply

    Sorry about that.
    YES the war file contains source code and i just want to convert in to a MyEclipse project.
    Thanks

    #231873 Reply

    Riyad Kalla
    Member

    Quick way:

    1) File > New > Project > Web Project
    2) Grab the root of your source tree and drop it into the /src dir.
    3) Grab the root of the WAR file (has JSPs in it, your WEB-INF dir in it, etc.) and drop it into your WebRoot dir, say yes to overwriting everything.

    4) Double check that /src is your Source dir and that /WebRoot/WEB-INF/classes is your output dir.
    5) Double check that every library in your /WebRoot/WEB-INF/lib dir was added to your build path.

    Viola, all done.

    #231877 Reply

    I’m not getting it.
    This is struts application, the directory structure in detail is

    Logon(projname)
    –dist
    –META-INF
    –pages
    Logon.jsp
    Welcome.jsp
    –WEB-INF
    classes
    dist
    doc
    lib
    src
    java
    build.xml
    struts.tld
    struts-bean.tld
    struts-config.xml
    struts-form.xml
    struts-html.xml
    struts-logic.xml
    struts-template.xml
    web.xml
    –index.jsp

    Can you help me in getting this in MyEclipse proj.?

    #231878 Reply

    Sorry it should look like this

    Logon(projname)
    –dist
    –META-INF
    –pages
    —-Logon.jsp
    —-Welcome.jsp
    –WEB-INF
    —-classes
    —-dist
    —-doc
    —-lib
    —-src
    ——java
    ——build.xml
    —-struts.tld
    —-struts-bean.tld
    —-struts-config.xml
    —-struts-form.xml
    —-struts-html.xml
    —-struts-logic.xml
    —-struts-template.xml
    —-web.xml
    –index.jsp

    #231881 Reply

    Riyad Kalla
    Member

    Martin, what I said still applies to this:

    1) Unzip your war file someplace
    2) Go into that dir, hit CTRL-A to select all the files
    3) Switch back to a NEW Web Project, select the WebRoot dir, right click and select Paste.
    4) In Eclipse, drill down to your WebRoot/WEB-INF/src dir, grab everything in that dir and drop it in your top level /src dir, and erase that stray /src dir.

    Then open up your project preferences and make sure all the JARs in your WebRoot/WEB-INF/lib dir are in your build path, and you are done.

    #231896 Reply

    hi Riyad,
    Thanks for ur support,
    I’m getting an error in the following jsp with error description
    The end tag “</logic:notPresent” is unbalanced.
    I’m not getting the error if i deploy the application directly thru tomcat.
    I get it only in eclipse editor.
    ————————————————————————————

    <%@ taglib uri=”/tags/struts-bean” prefix=”bean” %>
    <%@ taglib uri=”/tags/struts-html” prefix=”html” %>
    <%@ taglib uri=”/tags/struts-logic” prefix=”logic” %>
    <HTML>
    <HEAD>
    <TITLE>Welcome!</TITLE>
    <html:base/>
    </HEAD>
    <BODY>
    <logic:present name=”user”>
    <H3>Welcome <bean:write name=”user” property=”username”/>!</H3>
    </logic:present>
    <logic:notPresent scope=”session” name=”user”>
    <H3>Welcome World!</H3>
    </logic:notPresent>
    <html:errors/>
    <UL>
    <LI><html:link forward=”logon”>Sign in</html:link></LI>
    <logic:present name=”user”>
    <LI><html:link forward=”logoff”>Sign out</html:link></LI>
    </logic:present>
    </UL>
    <IMG src=’struts-power.gif’ alt=’Powered by Struts’>
    </BODY>
    </HTML>

    <%–

    If user is logged in, display “Welcome ${username}!”
    Else display “Welcome World!”
    Display link to log in page; maintain session id if needed.
    If user is logged in, display a link to the sign-out page.

    Note: Only the minimum required html or Struts custom tags
    are used in this example.

    –%>

    #231902 Reply

    Riyad Kalla
    Member

    Try and right click on your project, go to MyEclipse > Remove all Error Markers, then go to the Project menu item and select “Clean” and have it rebuild your project. Did it popup again? What line exactly was it marking?

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: how to open a war file and deploy as a seperate project

You must be logged in to post in the forum log in