Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8982049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:29:20+00:00 2026-06-15T20:29:20+00:00

I was working on a JSF 1.x example, which has some EL conflict in

  • 0

I was working on a JSF 1.x example, which has some EL conflict in JSPs.
the line actionListener="#{helloBean.addControls} is shooting an issue.

The error is :

HTTP Status 500 - /JSP/hello.jsp (line: 37, column: 2) A literal value was specified for attribute actionListener that is defined as a deferred method with a return type of void. JSP.2.3.4 does not permit literal values in this case

My project Description is as follows :

Package Structure :

POC

Maven Dependencies :

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.achutha.labs</groupId>
    <artifactId>02JsfExample</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>02JsfExample</name>

    <dependencies>

        <dependency>
            <groupId>javax.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>1.2_14</version>
        </dependency>
        <dependency>
            <groupId>javax.faces</groupId>
            <artifactId>jsf-impl</artifactId>
            <version>1.2_14</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
        </dependency>

        <!-- EL -->
        <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>el-impl</artifactId>
            <version>2.2</version>
        </dependency>


    </dependencies>


    <build>
        <finalName>JavaServerFaces</finalName>

        <plugins>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tomcat-maven-plugin</artifactId>
                <configuration>
                    <url>http://localhost:8090/manager/text</url>
                    <server>TomcatServer</server>
                    <path>/balaji</path>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

Faces Configuration :

<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC
     "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
     "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">

<faces-config>
    <managed-bean>
        <description> The one and only HelloBean.</description>
        <managed-bean-name>helloBean</managed-bean-name>
        <managed-bean-class>com.achutha.bean.HelloBean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>



    <navigation-rule>
        <description>Navigation From the Hello Page.</description>
        <from-view-id>/JSP/hello.jsp</from-view-id>
        <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>/JSP/goodbye.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>

</faces-config>

Deployment Descriptor (web.xml) :

<?xml version="1.0" encoding="UTF-8"?>
<!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>Hello, World!</display-name>
    <description>Welcome to JavaServer Faces</description>

    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>/JSP/hello.jsp</welcome-file>
    </welcome-file-list>


</web-app>

hello.jsp

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>

<f:view>
    <html>
<head>
<title>JSF In Action - Hello, world!</title>
</head>
<body>
    <h:form id="welcomeForm">
        <h:outputText id="welcomeOutput" value="Welcome to JavaServer Faces !"
            style="font-family: Arial, sans-serif; font-size: 23; color: green;" />

        <p>
            <h:message id="errors" for="helloInput" style="color: red" />
        </p>

        <p>
            <h:outputLabel for="helloInput">
                <h:outputText id="helloInputLabel"
                    value="Enter Number of controls to display: ">

                </h:outputText>

                <h:inputText id="helloInput" value="#{helloBean.numControls}"
                    required="true">
                    <f:validateLongRange minimum="1" maximum="500" />
                </h:inputText>
            </h:outputLabel>
        </p>

        <p>
            <h:panelGrid id="controlPanel" binding="#{helloBean.controlPanel}"
                columns="20" border="1" cellspacing="0" />
        </p>

        <h:commandButton id="redisplayCommand" type="submit" value="Redisplay"
            actionListener="#{helloBean.addControls}" />

        <h:commandButton id="goodbyeCommand" type="submit" value="Goodbye"
            actionListener="#{helloBean.goodbye}" immediate="true"/>

    </h:form>

</body>

    </html>

</f:view>

goodbye.jsp :

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<f:view>
    <html>
<head>
<title>Jsf in Action - Hello World!</title>
</head>
<body>
    <h:form id="goodbyeForm">
        <p>
            <h:outputText id="welcomeOutput" value="Good Bye"
                style="font-family: Arial, sans-serif; font-size: 24; font-style: bold; color: green;" />

        </p>
        <p>
            <h:outputText id="helloBeanOutputLabel"
                value="Number of controls displayed: " />
            <h:outputText id="helloBeanOutputLabel"
                value="#{helloBean.numControls}" />
        </p>
    </h:form>

</body>
    </html>
</f:view>

Bean class :

package com.achutha.bean;

import java.util.List;

import javax.faces.application.Application;
import javax.faces.component.UIComponent;
import javax.faces.component.html.HtmlOutputText;
import javax.faces.component.html.HtmlPanelGrid;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;

public class HelloBean {

    private int numControls;
    private HtmlPanelGrid controlPanel;

    public int getNumControls() {
        return numControls;
    }

    public void setNumControls(int numControls) {
        this.numControls = numControls;
    }

    public HtmlPanelGrid getControlPanel() {
        return controlPanel;
    }

    public void setControlPanel(HtmlPanelGrid controlPanel) {
        this.controlPanel = controlPanel;
    }

    public void addControls(ActionEvent actionEvent) {
        Application application = FacesContext.getCurrentInstance()
                .getApplication();

        List<UIComponent> children = controlPanel.getChildren();

        children.clear();

        for (int count = 0; count < numControls; count++) {
            HtmlOutputText output = (HtmlOutputText) application
                    .createComponent(HtmlOutputText.COMPONENT_TYPE);
            output.setValue(" " + count + " ");
            output.setStyle("color: blue");
            children.add(output);
        }
    }

    public String goodbye() {
        return "success";
    }

}

Clean Deployment : The application is deploying itself fine on Tomcat 7. I checked the deployed package structure on &tomcat_home%/webapps and everything is in proper place as expected.

But when i run the application on a browser I get the following error :

HTTP Status 500 - /JSP/hello.jsp (line: 37, column: 2) A literal value was specified for attribute actionListener that is defined as a deferred method with a return type of void. JSP.2.3.4 does not permit literal values in this case

type Exception report

message /JSP/hello.jsp (line: 37, column: 2) A literal value was specified for attribute actionListener that is defined as a deferred method with a return type of void. JSP.2.3.4 does not permit literal values in this case

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /JSP/hello.jsp (line: 37, column: 2) A literal value was specified for attribute actionListener that is defined as a deferred method with a return type of void. JSP.2.3.4 does not permit literal values in this case
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:408)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:149)
    org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1151)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:875)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1539)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:894)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1539)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:894)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1539)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
    org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
    org.apache.jasper.compiler.Node$Root.accept(Node.java:475)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
    org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1795)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:217)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

I am not finding a suitable one stop solution for this issue.
It is the EL used on the line actionListener="#{helloBean.addControls} which is raising the complications.
Please let me know the solution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:29:22+00:00Added an answer on June 15, 2026 at 8:29 pm

    Change inside your web.xml

    <webapp>
    

    into

    <web-app version="2.5"
          xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
          http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    

    in addition to the above try adding

    to your web-app…

    like this

     <web-app version="2.5"
          xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
          http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
          xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
          id="WebApp_ID">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on JSF tabs example which use lazy loading: <h:form prependId=false> <h:panelGroup id=tabs
I'm working with jsf 2 and I'm getting some behaviour which I find hard
Working with JSF 2.0 (and Primefaces), is there a way to fire an ActionListener
I'm working on this JSF table which is used for displaying data. When I
I'm working on a Java EE (which I'm fairly new to) web application (JSF,
i am working in JSF Application and in this application using some code i
I'm working on JSF page which displays settings values and updates settings into Oracle
I've been working on JSF 2.1/Primefaces 3.4.1 and I've been having some troubles with
I am working on a JSF 2.0 website. The website has two kind of
Where can i find working example / tutorial for simple webapp on JSF 2.0

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.