Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSP
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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
JSP
Why aren't EL interpreted in JSP file?
Joey Sanchez
Ranch Hand
Posts: 101
I like...
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Environment:
Tomacat 8
Maven
Struts2
Why doesn't work EL in this
JSP
file?
el.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!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=ISO-8859-1"> <title>Insert title here</title> </head> <body> ${5+3 } ${5+hola } <s:url action="registerInput" var="registerInputLink" /> ${registerInputLink} </body> </html>
and what I see in the web page is:
${5+3 } ${5+hola } ${registerInputLink}
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Most likely cause is usually a mis-configured web.xml.
See:
https://coderanch.com/how-to/java/ElOrJstlNotWorkingAsExpected
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Joey Sanchez
Ranch Hand
Posts: 101
I like...
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
web.xml
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <display-name>Archetype Created Web Application</display-name> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app>
I figured out, and yes it was a misconfigured web.xml. I had to change
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app>
with this other code
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Yup, that's the usual culprit.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
using 4 includes only shows bgcolor of first
http error404
Could not find action or result
I got http-500 error in servlet and jsp.how to find error?
Unterminated <c:redirect> in jsp file
More...