错误404:SRVE0190E:找不到文件:/在bluemix中构建应用程序

问题描述:

我很理解bluemix,我可以在其中部署应用程序,但是当我输入URL时,出现此错误。有人能给我一个解释吗?错误404:SRVE0190E:找不到文件:/在bluemix中构建应用程序

:Error 404: SRVE0190E: File not found:/

这是我的servlet类:

@WebServlet(description = "My First Servlet", urlPatterns = { "/FirstServlet" , "/FirstServlet.do"}, initParams = {@WebInitParam(name="id",value="1"),@WebInitParam(name="name",value="pankaj")}) 
public class FirstServlet extends HttpServlet { 
    private static final long serialVersionUID = 1L; 
    public static final String HTML_START="<html><body>"; 
    public static final String HTML_END="</body></html>"; 

    /** 
    * @see HttpServlet#HttpServlet() 
    */ 
    public FirstServlet() { 
     super(); 
     // TODO Auto-generated constructor stub 
    } 

    /** 
    * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 
    */ 
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 
     PrintWriter out = response.getWriter(); 
     Date date = new Date(); 
     out.println(HTML_START + "<h2>Hi There!</h2><br/><h3>Date="+date +"</h3>"+HTML_END); 
    } 

    /** 
    * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) 
    */ 
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 
     // TODO Auto-generated method stub 
    } 

} 

和JSP文件:

<%@page import="java.util.Date"%> 
<%@ page language="java" contentType="text/html; charset=US-ASCII" 
    pageEncoding="US-ASCII"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> 
<title>Hello</title> 
</head> 
<body> 
<h2>Hi There!</h2> 
<br> 
<h3>Date=<%= new Date() %> 
</h3> 
</body> 
</html> 

如何解决这个问题?

在此先感谢。

什么是您的.jsp文件名? 输入index.jsp作为文件名,然后重试!