Regards,<br />Satya<br />SCJP,SCWCD
Regards,<br />Satya<br />SCJP,SCWCD
Regards,<br />Satya<br />SCJP,SCWCD
Regards,<br />Satya<br />SCJP,SCWCD
package scwcd;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class TestServlet1 extends HttpServlet
{
public void doPost(HttpServletRequest request, HttpServletResponse
response)throws IOException, ServletException
{
java.util.ArrayList movieNames = new java.util.ArrayList();
movieNames.add("Pan's Labyrinth");
movieNames.add("My Sassy Girl");
movieNames.add("Black Hawk Down");
request.setAttribute("movieNames", movieNames);
request.setAttribute("person", p);
RequestDispatcher view = request.getRequestDispatcher("result.jsp");
view.forward(request, response);
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
doPost(request, response);
}
}
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false"%>
<html><body>
<c:forEach var="i" begin="1" end="10" step="1">
${i}
</c:forEach>
<br>
<c:forEach var="movie" items="${movieNames}">
${movie}<br>
</c:forEach>
</body></html>
1 2 3 4 5 6 7 8 9 10
Pan's Labyrinth
My Sassy Girl
Black Hawk Down
rgrds,
Khushhal
Regards,<br />Satya<br />SCJP,SCWCD
Error Message: According to TLD or attribute directive in tag file, attribute items does not accept any expressions. When working on a J2EE (Java Enterprise Edition) web application with JSTL (JSP Standard Tag Library), this is a pretty common error.
Reason for this error is version incompatibility between JSP, Servlet and JSTL. Matching versions are listed below.
* JSP 1.2 , Servlet 2.3 , JSTL 1.0
* JSP 2.0 , Servlet 2.4 , JSTL 1.1
A good workman is known by his tools.
Shanika Wijerathna(scjp)
[My Blog]
All roads lead to JavaRanch
Regards,<br />Satya<br />SCJP,SCWCD
[My Blog]
All roads lead to JavaRanch
Shanika Wijerathna(scjp)
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |