HTTP Status 500 – Internal Server Error
Type Exception Report
Message An exception occurred processing [/index.jsp] at line [31]
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.apache.jasper.JasperException: An exception occurred processing [/index.jsp]
Root Cause
java.lang.NullPointerException
org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:40)
org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:40)
org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:48)
org.apache.jsp.index_jsp._jspx_meth_s_005fa_005f0(index_jsp.java:300)
org.apache.jsp.index_jsp._jspService(index_jsp.java:173)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:466)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:327)
javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
Note The full stack trace of the root cause is available in the server logs. Apache Tomcat/9.0.80
I couldn't find exactly why the NullPointerException is coming. In index.jsp file the <s:a> tag is not working fine it is showing
org.apache.jasper.JasperException: An exception occurred processing.
How to make this tag work so the NullPointerException won't occur.
In JSP you have used Struts tags. They requires to use a Struts filter running. Also don't use direct access to the JSP. You are using Tomcat as an application server. It is configured by default to use
index.jspas a welcome page and it served by default servlet in Tomcat. Even Struts is not involved here. So, Struts tags will fail to work.Under the hood if you look at stacktrace you will see that
<s:a>tag is trying to get a value stack from the action context but it isnullbecause a request isn't served by Struts filter.What you need is to learn basics of Struts application. Here an example tutorial from the Struts getting started docs. How to create Struts 2 Web application. Especially the section 5 where you can see the Struts filter configuration.