Results 1 to 2 of 2

Thread: Learning spring

  1. #1
    karq is offline Member
    Join Date
    May 2010
    Posts
    63
    Rep Power
    0

    Default Learning spring

    Hey everyone,


    I started to learn spring mvc , i'm 2 days into it and I still cant figure out, how does it work(theres like too much info).I even dont know how to make a simple form and proccess the form's info. I know that it should work like codeIgniter in php, that the controller file controls the view file. Maybe i'm missing something?? What should I learn before learning spring?? I know a little jsp and servlets.

    Heres one of my problems:
    this is my Controller file:
    Java Code:
    public class HelloWorldController implements Controller {
    
     
    
        public ModelAndView handleRequest(HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception {
           String aMessage = "tere tere";
    
            ModelAndView md = new ModelAndView("welcome");
            md.addObject("welcomeMessage", aMessage);
            return md;
        }

    dispatcher-servlet.xml, there I added this line
    Java Code:
    <bean name="/welcome.htm" class="controller.HelloWorldController" />
    And in the web-inf/jsp folder I have a welcome.jsp file with this line added
    Java Code:
    <h1>${welcomeMessage}</h1>
    But when I deploy it and run it, then I get a
    Java Code:
    HTTP Status 404 -
    
    type Status report
    
    message
    
    description The requested resource () is not available.








    }[/CODE]


    Sorry for my english!!!
    Last edited by karq; 09-14-2010 at 07:15 PM. Reason: New Question

  2. #2
    Join Date
    Sep 2010
    Posts
    12
    Rep Power
    0

    Default Hi

    this error occur when your path is not true, then you have to check file path that you link to it. like /welcome.htm and web-inf/jsp.
    you can use from one IDE that support spring to link a file with CTRL+Space, i think you can use eclipse IDE with spring plugin :
    http://www.eclipse-plugins.info/ecli...ils.jsp?id=506

Similar Threads

  1. Learning Resources
    By Shadukyo in forum New To Java
    Replies: 1
    Last Post: 05-31-2010, 05:45 PM
  2. learning packages
    By shashanksworld in forum New To Java
    Replies: 7
    Last Post: 03-26-2010, 12:03 PM
  3. Pre-requisites for learning JSP
    By xtiano77 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 03-23-2010, 06:03 PM
  4. e-learning
    By Vipan Konnect in forum Advanced Java
    Replies: 3
    Last Post: 11-21-2009, 04:29 PM
  5. Learning Java
    By jjoshua2 in forum New To Java
    Replies: 2
    Last Post: 12-20-2008, 02:46 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
  •