facebook

WEB-INF/jsp

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #202013 Reply

    I use Struts 1.1.
    I would like to have all my JSP files in the WEB-INF/jsp directory. This is a common practice with Struts so that nobody can access jsp files directly without Struts actions which link to the JSP files.
    However in MyEclipse I get the error messages that those JSP files are not in base path (…/WebRoot/).
    What can I do so that MyEclipse can handle that location for JSP files?
    Thomas

    #202021 Reply

    Riyad Kalla
    Member

    Thomas,
    I just created a project with the following dir structure:

    Project
    /src <– Java class source
    /webroot <– Well, the webroot 🙂
    /WEB-INF
    /classes
    /lib
    /jsp
    + index.jsp

    And everything works fine. Can you give us your directory structure AND the settings from your settings:
    Right click on project root -> MyEclipse-Web -> (all the settings from here)

    Thanks!

    #202032 Reply

    Hi,

    ok, I’ll try to ask my question in a better way.

    I would like to know what kind of structure of my source files I would need to get the following WEB output:

    /WebRoot/WEB-INF/jsp

    That means I want to create my JSP files somewhere, maybe in /jsp, and when MyEclipse builds and deploys the Web application, it should copy the JSP files to /WebRoot/WEB-INF/jsp, and not to
    /WebRoot.

    The reason is that I want to use some Struts Action classes to access the JSP files (to make forwards to them).

    Thomas

    #202033 Reply

    Riyad Kalla
    Member

    Thomas,
    I’m not clear why you would need MyEclipse to move/copy the JSP files anywhere. As you are developing, create them in the WEB-INF/jsp directory and when you deploy they will stay there, everything works fine. Keep in mind that when MyEclipse deploys your webapplication, it is basically taking everything recursively under your WebRoot directory and either creating a WAR with it, or copying it directly to your application server. So however you want your app to look when deployed, just develop like that. I suggest the following hierarchy as an example to get what you want:

    
    Project Root
      + /src <-- Java source files, actions, forms, beans, etc.
      + /doc <-- All documentation
        + README
        + LICENSE
        + /api <-- Generated Javadoc
      + /webroot <-- your webapp is deployed from this point
        + index.jsp
        + /WEB-INF
          + struts-html.tld
          + struts-bean.tld
          + ...
          + /classes <-- Build output path
          + /jsp <-- All JSPs except for the entry one go here
            + login.jsp
            + logout.jsp
            + profile.jsp
            + register.jsp
            + ...
          + /lib <-- All libs for app
            +  struts.jar
            +  ...
    

    Now when you deploy, you’re all set.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: WEB-INF/jsp

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