Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsp 我想解决这个问题。什么';没有价格有什么意义?_Jsp - Fatal编程技术网

Jsp 我想解决这个问题。什么';没有价格有什么意义?

Jsp 我想解决这个问题。什么';没有价格有什么意义?,jsp,Jsp,addSchedule.jsp <%@ page contentType="text/html;charset=euc-kr" session="true" %> <%@ page import="book.ch9.*,book.ch9.CharConversion,java.io.*" %> <%request.setCharacterEncoding("euc-kr"); %> <jsp:useBean id="schDb" class="book.

addSchedule.jsp

<%@ page contentType="text/html;charset=euc-kr" session="true" %>
<%@ page import="book.ch9.*,book.ch9.CharConversion,java.io.*" %>
<%request.setCharacterEncoding("euc-kr"); %>
<jsp:useBean id="schDb" class="book.ch9.scheduleFileDb" scope="application" />

<html>
<head>
<title>addSchedule.jsp</title>
</head>

<body bgcolor="white">

<%  
    User user = (User)session.getValue("user");

    String id = user.getUserId();
    String day = request.getParameter("day");
    String hour = request.getParameter("hour");
    String schedule = request.getParameter("schedule");     
    String korSchedule = CharConversion.E2K(schedule);

    int index = schDb.getIndex();       

    try{    
        schDb.add(id,day,hour,korSchedule);         
    } catch(Exception e){
        e.printStackTrace(new PrintWriter(out));
        return;
    }
%>

<jsp:forward page="welcome.jsp">
<jsp:param name="schedule" value="<%=korSchedule %>"/> 
</jsp:forward>

</body>

</body>
</html>

addSchedule.jsp
如图所示,String id=user.getUserId();我不知道为什么这里有错误

我努力寻找,但找不到任何答案


如图所示,您有一个
NullPointerException
。考虑验证存储会话属性的位置。然后,尝试通过以下方式获取会话属性:

HttpSession session = request.getSession(true);
User user = (User)session.getAttribute("user");

请将文本作为文本发布,而不是作为文本图像的链接。