Marco Fung

+ Follow
since Jul 25, 2005
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Marco Fung

I tried it, it works.

But I had a mock question in j2eecertificate, it said it's not work.
18 years ago
Assume the name, attribute of a bean is correctly set.

So that
<jsp:getProperty name="id" property="firstName"/>
is valid.


<jsp:getProperty name="id" property="firstName"></jsp:getProperty>

also valid? Does </jsp:getProperty> tag exists?
18 years ago
Try change your JSP to

<form method ="GET" action = "/">

<center><input type="submit"></center>

If I am right, since JSP will translate and compile into servlet. When a relative path is used, the generate JSP_servlet will use it related path to find another servlet.

In the cases, the relative path included the directory of the jsp, which doesn't fall into the context path.
This is the servlet code:

package com.example.web;

import com.example.model.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;

public class BeerSelect extends HttpServlet{

public void doPost(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException{

PrintWriter out = res.getWriter();

out.println("Beer Selection Advice<br>");
String c = req.getParameter("COLOR");

BeerExpert be = new BeerExpert();
List result = be.getBrands(c);

req.setAttribute("styles", result);

RequestDispatcher view = req.getRequestDispatcher("result.jsp");
view.forward(req, res);


And this is my DD:

<web-app xmlns=""





<servlet-name>Ch3 Beer</servlet-name>

<servlet-name>Ch3 Beer</servlet-name>


And this is my loginPage.html:

Please login:

<form method="POST" action="j_security_check">
<input type="text" name="j_username">
<input type="password" name="j_password">
<input type="submit" value="Enter">

Hi, I have a problem when using a FORM authentication method in my web app.

my DD is as follow:


I have no problem to trigger the loginPage.html, when I try to accessed a authentication required servlet that uses a doPost() method without doGet().

When I typed in a invalid username/password pair, it go to loginError.html page.

However, when I typed in a valid username/password pair, I will be forward to a error page

--> HTTP 405 : HTTP method GET is not supported by this URL

But when i use the same browser and try to access the same servlet again, it went through with no problem and generate the expected output.

Can anyone please tell me what happen? I use Tomcat 5.0.28
In your tomcat setting, you use Admin.

but in your web.xml, you use a different name, Adm.
In your Tld file, have you try to define the movieList rtexprvale to true?

18 years ago