Filling HTML dropdown list in JSP with values fetched from database in Servlet

Assuming that you’ve the model and DB part already finished (as per the comments on the question), just create a servlet class and implement the doGet() method accordingly. It’s relatively simple, just retrieve the list of passengers from the DB, store it in request scope and forward to the JSP which should present it. The … Read more

How to call parameterized method from JSP using JSTL/EL

You can only invoke methods with arguments in EL if you’re targeting and running a Servlet 3.0 compatible container (e.g. Tomcat 7, Glassfish 3, JBoss AS 6, etc) with a web.xml declared conform Servlet 3.0. This servlet version comes along with EL 2.2 which allows invoking arbitrary instance methods with arguments. Assuming that you’ve a … Read more

java.lang.LinkageError: javax.servlet.jsp.JspApplicationContext.getExpressionFactory

That will happen when you include server-specific libraries of a different server make/version in the /WEB-INF/lib of your web application, such as jsp-api.jar, el-api.jar, servlet-api.jar, etc. You need to remove them all. The /WEB-INF/lib should not contain any server-specific libraries. They belongs in the specific server itself (Tomcat has them in its /lib folder already). … Read more

javax.servlet.ServletException: javax.servlet.jsp.JspTagException: Don’t know how to iterate over supplied “items” in

Caused by: javax.servlet.ServletException: javax.servlet.jsp.JspTagException: Don’t know how to iterate over supplied “items” in <forEach> That will happen when the <c:forEach items> does not refer a valid object over which it can iterate. The object should be an Object[] (a plain array), a Collection, Map, Iterator, Enumeration or String (see also source code). Anything else can’t … Read more

There is no Action mapped for namespace [/] and action name [login] associated with context path [/Struts2Test]

Issues related to: There is no Action mapped for namespace and action name associated with context path If you use URL to call an action, make sure this URL is mapped to the Struts configuration. To troubleshoot the issue with URL mapping you can use config-browser plugin. Simply add this plugin to your project dependencies … Read more