Directory Structure in Spring Framework

Posted on 2005-05-09
Last Modified: 2008-02-01
I am trying to understand how context root path is resolved.
The directory structure of my current application is some thing like this,

             |- classes      
             |- lib

JSP pages need some images that are in images folder and .js file that are in js folder.
Problem is I am not able to access any of them using /images/some.gif and /js/cal.js

Reference like this works on dev, but not on QA. QA environment is different from Dev. It have one proxy which redirects requests to either one of 2 servers.

In dev, it is like both client and server are on same machine.

I am not sure if this is something to do with view resolvers configured in xx-servlet.xml file.


        <bean id="viewResolver"            class="org.springframework.web.servlet.view.InternalResourceViewResolver">       <property name="viewClass">                  <value>org.springframework.web.servlet.view.JstlView</value>            </property>
      <property name="prefix">
      <property name="suffix">


Can some one please help me to understand so that I can get access to images and .js file from my jsp file in QA aswell.

Thank you
Question by:vsaritha_9
    LVL 29

    Expert Comment

    >>/images/some.gif and /js/cal.js

    using /* indicates that you are using the root context of the webserver(this is not the same as the webapp context). If your app is named like this "http://localhost:8080/dev/index.jsp" you would need to write "/dev/images.some.gif" and "/dev/" as the root context is http://localhost:8080.

    Your initial ones would work if your webapp was in the root context of "http://localhost:8080/index.jsp" as it is relatice from that position.

    Author Comment

    Thank you bloodredsun,
    sorry for late reply.

    I was able to solve my problem by giving relative path to the folder using (..\..\).

    I have one more question. This is related to spring framework.

    Do you know when showNewForm() will be called by the spring framework?

    Your reply will be greatly appreciated.

    Thank you
    LVL 29

    Expert Comment

    >>Do you know when showNewForm() will be called by the spring framework?

    Sorry no. We use a custom version of a framework like Spring but I have never used Spring.
    LVL 29

    Expert Comment

    LVL 1

    Accepted Solution

    PAQed with points refunded (50)

    EE Admin

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Great sound, comfort and fit, excellent build quality, versatility, compatibility. These are just some of the many reasons for choosing a headset from Sennheiser.
    This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now