hi

what i wan to do is to get the customer ID from the glassfisn database and displaindey it in a drop down box in a jsp page.

in the index.jsp page how to i call the servlet so that the the servlet would load the jsp page?

i have attached the jsp and the servlet page

Member Avatar for LastMitch

I'm not gonna download files.

But You can do this:

request.getRequestDispatcher("../folder/index.jsp").forward(request, response);

Regarding about drop down box that's pretty interesting you can try this:

@WebServlet("customer")
public class customer extends HttpServlet {

@EJB
private customer service;

@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    List<customer> customer = service.list();
    request.setAttribute("customer", customer);
    request.getRequestDispatcher("../folder/index.jsp").forward(request, response);
}
}

haven't tryied it
will let youknow if it works
thanks

do i include the

    request.getRequestDispatcher("../folder/index.jsp").forward(request, response);

in the servlet?

but how do i call a servlet from a jsp page link

<td><a href="Vehicle.jsp"><strong>Vehicle</strong></a>   

find the <url_pattern> tag value of your servlet in the web.xml and provide that value/path in the href='your_servlet' tag as shown bellow

<a href="url_pattern_of_your_servlet"><strong>Vehicle</strong></a>

let me know status as well as if you have any doubt in my clarification

happy coding

so how do i solve this then

appreciate a reply
thank

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.