I have servlet which does a forward using requestdispatcher() to one of my jsp pages
request.getRequestDispatcher("/WEB-INF/view/mypage.jsp").forward(
request, response);
The target mypage.jsp has some jquery goodness which required to do some show/hide stuff but for some reason the jquery is not being triggered when the jsp is displayed after being forwarded from the servlet, but it works when I directly access the page via the address bar(I placed the page outside the web-inf to access is directly).
Even a simple <body onload="alert('Testing')">
is also not working.
I'm also using HTML5 and jquerymobile in my jsp.
Any replies to fill-up the gaps in my knowledge would be great. Thanks
Following is my jsp page :
<!DOCTYPE html>
<html>
<head>
<title>My App</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
</head>
<body onload="alert('Even this is not popping up')">
-- Stuff--
</body>
</html>
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
</head>
<body onload="alert('Even this is not popping up')">
-- Stuff--
</body>
</html>