Results 1 to 3 of 3

Thread: Need Help - New to Spring MVC

  1. #1
    Join Date
    Nov 2004
    Posts
    159

    Default 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".

    Code:
    <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. #2
    Join Date
    Aug 2004
    Location
    Auburn, AL, USA.
    Posts
    106

    Default

    First I'd try:
    Code:
    <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. #3
    Join Date
    Nov 2004
    Posts
    159

    Default

    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?

    Thanks!

Similar Threads

  1. Spring MVC Web Framework versus Struts
    By biguniverse in forum Web Flow
    Replies: 27
    Last Post: Aug 29th, 2012, 03:57 AM
  2. Replies: 5
    Last Post: Aug 9th, 2008, 05:30 AM
  3. A Spring Class Loader?
    By azzoti in forum Architecture
    Replies: 8
    Last Post: May 7th, 2005, 04:02 AM
  4. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  5. Replies: 2
    Last Post: Jan 21st, 2005, 04:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •