Announcement Announcement Module
No announcement yet.
Need Help - New to Spring MVC Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need Help - New to Spring MVC

    Hello everyone,

    I'm basically a server side developer with some knowledge of struts. With the help of "Spring Live", i developed a simple web application. In this each form will take input that corresponds to one object.

    As i add more complexity into this form, i ran into a very real time situation, where i got stuck and need help on how to do this.

    Here's my requirement. I've an object Project object which has one-to-many relationship with object Resource. In my form "editProject.html" i would like to add a button to "Add Resources to this Project". Hence i added the following line to my "projectForm.jsp".

    <button onclick="location.href='editResource.html'"</button>
    I already have a form "editResource.html" which works fine separately. When i click this button, this link takes me to 'editProject.html' NOT 'editResource.html' page. Could someone point out what is that i'm missing?

    In my urlMappings in action-servlet.xml file, 'editResource.html' points to ResourceFormController.

    When i get to this page, i would like the ability to add new resource to "the project from which i clicked the add resource button".

    Could some one tell me how do i do that? Any code sample would be great.

    Thanks in advance!

  • #2
    First I'd try:
    <input type="button" onclick="location.href='editResource.html'"/>
    If that doens't work recheck your action-servlet.xml file to make sure something weird isn't going on (may be post part or all of it). Also, you can try turing on/up logging for the Spring classes, to see if you notice any suspicous messages that might point to a configuration problem.

    Also, what browser do you use? If you aren't already using it, I highly recommend installing FireFox with the View Live HTTP Headers plugin (let's you see all the redirects, etc) as this can also help spot things like redirects, or form submissions that are pointed to incorrect URLs, etc.


    • #3
      Thanks rrsIPOV. I fixed that problem.

      But i'm yet to figure out how to connect the Project object with Resource object if i click "Add resource to project" from the "Project" Form.

      Could someone please let me know?