hello everyone i have to show a page index.jsp and in this page i have used the onload submit
Code:
<script type="text/javascript">
		function myfunc () {
		var frm = document.getElementById("my_form");
		frm.submit();
		}
		window.onload = myfunc;
	</script>
<form id="my_form" action="tempmonitor" method="post">
the above is my jsp code and i have printed hello on this page. But when i hit the URL localhost:8090/tempmonitoringsystem/index.jsp. It shows index.jsp for nanosec den went away to the folowing URL localhost:8090/tempmonitoringsystem/tempmonitor and i don't know where it is redirecting to. I am Attaching my servlet code as well as xml code.

Code:
 TempMonitorServlet.java
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
		throws ServletException, IOException {
		System.out.println("hello world");
		String path = "E:\\"; 
		 
		  String files;
		  File folder = new File(path);
		  File[] listOfFiles = folder.listFiles(); 
		 
		  for (int i = 0; i < listOfFiles.length; i++) 
		  {		 
			  if (listOfFiles[i].isFile()) 
			  {
				  files = listOfFiles[i].getName();
				  
				  if (files.endsWith(".txt") || files.endsWith(".TXT"))
				  {
					  System.out.println(files);
					  ReadingFromFile read_file = new ReadingFromFile();
					  
					  String last_line_from_file = read_file.read(files) ;
					  System.out.println("\n"+last_line_from_file);
					  if(last_line_from_file != null)
					  {
						 
						  drawImage(req,resp ,last_line_from_file,files) ;
					  }
				  }
			  }
		  }
}

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>ZigbeeRest</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
  
  <servlet>
        <servlet-name>tempmonitor</servlet-name>
        <servlet-class>
			tempmonitor.TempMonitorServlet
		
        </servlet-class>
        <init-param>
            <param-name>javax.ws.rs.Application</param-name>
            <param-value>com.restful.Zigbee.services.ZigbeeApplication</param-value>
        </init-param>
    </servlet>

    <servlet-mapping>
        <servlet-name>tempmonitor</servlet-name>
        <url-pattern>/tempmonitor</url-pattern>
    </servlet-mapping>
 
</web-app>