facebook

I update jsps and it doesn’t move them to my webroot[Closed]

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #206027 Reply

    iklotzko
    Member

    When I update a jsp in my source it doesn’t move the resource to the web root and I have to manually move it there.

    Is this normal behavior for MyEclipse?

    Ira

    Thank you for any help you can provide.
    – System Setup ——————————-
    Operating System and version: Windows A
    Eclipse version: 3.0 M8
    Eclipse build id: 200403261517
    Fresh Eclipse install (y/n): y
    If not, was it upgraded to its current version using the update manager?
    Other installed external plugins: some, but they were removed
    Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*: 8
    MyEclipse version: 3.7.2
    Eclipse JDK version: 1.4.2_03
    Application Server JDK version: tomcat 5.x
    Are there any exceptions in the Eclipse log file? ?

    – Message Body ——————————-

    #206033 Reply

    Riyad Kalla
    Member

    When I update a jsp in my source it doesn’t move the resource to the web root and I have to manually move it there.

    I’m not clear what you mean by “update” here, but this sounds normal. MyEclipse does not modify the project structure at all during editing or at all during deployment.

    Your JSPs need to be under your webroot at all times, or you get an error for the ones that are not. We will relax this requirement in future releases, but for now this is how it works.

    #206040 Reply

    iklotzko
    Member

    Riyad,

    So, are you saying my jsps have to be seperate from my source? How do I manage a project whereby I keep all my source files in a central location: for instance, for cvs (source versioning control). Do I have to modify the jsps under my web root, then move these files back over to my source directory?

    Thank you,
    ik

    #206041 Reply

    Riyad Kalla
    Member

    Ahh good question. See this FAQ entry for a good layout for the typical web project: http://www.myeclipseide.com/modules.php?op=modload&name=FAQ&file=index&myfaq=yes&id_cat=30#111

    You’ll notice that /src is for your Java source files (beans, servlets, etc.) while /webroot and anyplace under it are for your JSP pages. /webroot and everything under it are typically what get deployed to the application server, so it is traditional to compile your /src files into /webroot/WEB-INF/classes so you don’t ever have your source code on your server.

    In addition to that, you would typically have ALL of this (from the <project root>) under CVS. Of course you would add appropriate .cvsignore files for your classes directory and api directory… and other directories that had contents that could be regenerated. These are never meant to go into CVS.

    #206043 Reply

    iklotzko
    Member

    Great, I think I get it. But, just to make sure, i’ll use actual paths:

    I currently have my web-root to be: TOMCAT_HOME/webapps/
    I reassign my web-root to cetova-src/backend/web
    I retain my source root as cetova-src/backend/src

    When I deploy, it should build it to: TOMCAT_HOME/webapps/app-name?
    Will it place the jsps under the app-name dir. or under WEB-INF/classes, if it is the latter, can this be changed?

    Now, how do I reassign my web-root? It says I should use add/Remove Module dialog from my context menu, but I don’t have that, I have my project selected at the top node on package explorer.

    #206046 Reply

    Riyad Kalla
    Member

    I currently have my web-root to be: TOMCAT_HOME/webapps/
    I reassign my web-root to cetova-src/backend/web
    I retain my source root as cetova-src/backend/src

    Good change, your previous webroot was incorrect so this should help.

    When I deploy, it should build it to: TOMCAT_HOME/webapps/app-name?

    The deployment tool will use the context name you setup (Right click on Project, go to MyEclipse-Web, setup Web Context-root… lets say you called it “/cetova”) to deploy your app to TOMCAT_HOME/webapps/cetova (or whatever you called it) automatically. You’ll notice in the deployment dialog the path field is not editable, its done for you automagically.

    Will it place the jsps under the app-name dir. or under WEB-INF/classes, if it is the latter, can this be changed?

    Our project structure requiretments are that of an exploded WAR for, so technically speaking your JSP files should all be under your WebRoot directory. Some people like to hide them in /WEB-INF/jsp for security reasons, but no they will never go into your /classes dir automatically. And if you put them there manually, they are in the wrong place. Only compiled Java source files should be in there.

    Now, how do I reassign my web-root?

    This will be editable in the future again, but for now you need to edit the .mymetadata file that is in your project root. If you open up the Navigator View, you will be able to see it. Its just a text file (xml). You can also see the file in the Package Explorer View if you turn off .* filtering (using that V down arrow in the top right of the view).

    #206052 Reply

    iklotzko
    Member

    Okay, I’ve done this, and I can make a change to a class and I see the corresponding change on the server via. hot swapping (which is a great feature by the way). However, my jsps are still not moving over.

    #206054 Reply

    iklotzko
    Member

    I’ve made these changes, and tried to compile jsps, but now i get this message… hmmm..

    /cetova-main/cetova-src/backend/web/ListCategoriesReports.jsp) not in base path (C:/cetova-main/cetova/cetova-src/backend/web/)

    This is my .mymetadata

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <project-module context-root=”/cubewiz” name=”cubewiz”
    archive=”cetova.war” type=”WEB” id=”myeclipse.1082047768953″>
    <attributes>
    <attribute name=”webrootdir” value=”cetova/cetova-src/backend/web”/>
    </attributes>
    </project-module>

    Any ideas?

    ik

    #206312 Reply

    Scott Anderson
    Participant
Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: I update jsps and it doesn’t move them to my webroot[Closed]

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