Directory Structure in Spring Framework

Posted on 2005-05-09
Medium Priority
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
  • 3
LVL 29

Expert Comment

ID: 13960315
>>/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/js.cal.js" 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

ID: 14310188
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

ID: 14311176
>>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

ID: 15344638

Accepted Solution

Computer101 earned 0 total points
ID: 15364794
PAQed with points refunded (50)

EE Admin

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If anyone asked you to network diagram of the internet, it was drawn in the form of a fluffy cloud which further became known as cloud computing. Popularly cloud computing is defined as workloads that run over the internet in a commercial provider’s…
Social messanging services like WhatsApp and Facebook can help businesses in ways that many owners don't even imagine, giving new opportunities to connect with customers. Discover some of the most innovative things they can do for your company.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

862 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