Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Spring
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Tim Cooke
Liutauras Vilda
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Rob Spoor
Junilu Lacar
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Piet Souris
Carey Brown
Bartenders:
Forum:
Spring
Model Map problem : jsp doe not show object that i bind with model map
jas preet
Ranch Hand
Posts: 78
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Here is the code :
package practisepack; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; @Controller public class HomeController { @RequestMapping(value="/login",method=RequestMethod.GET) public ModelAndView viewLoginPage(){ ModelMap objModel = new ModelMap(); String message = "Welcome to home page"; objModel.addAttribute("message", message); return new ModelAndView("home",objModel); } }
Here is the
jsp
: home.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Home Page</title> </head> <body> ${message} </body> </html>
I get out as ${message} on the jsp page . I want the output on jsp as
Welcome to home page
Thanks Jaspreet ----- Nothing is permanent
misha nesterenko
Greenhorn
Posts: 28
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello, I have recently encountered the same problem
matter is not in model, If you bind correctly, object is contained in it, you have to specify correct xml schema
solution:
https://coderanch.com/t/527405/JSP/java/EL-not-working
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
NullPointerException at service.getPort().
Not able to Validate form using JSR-303 validation implementation in Spring MVC
Linking JSP pages in portlet application
Spring:bind tag for multiple objects
onSubmit() not getting called
More...