Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Web.xml  RSS feed

 
vivek sivakumar
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please tell me more about Web.xml, what i intend to do is there are 2 jsp pages , a.jsp and b.jsp . suppose any user tries to query b.jsp it should automatically redirected to a.jsp!!! is there a way to do this in web.xml file
 
Manohar Karamballi
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In first JSP page at begining include following code...
<jsp:forward page="URL for JSP2">
<jsp aram name="paramname" value="paramvalue">
</jsp>
Second line is required only if u have any parameters to send...
Rgds
Manohar
 
vivek sivakumar
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no i think u did not yet understand my question!!! what i want is if a user queries b.jsp in the location bar of browser then he should be automatically taken to a.jsp thats what i need.
 
Manohar Karamballi
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add following script at begining of b.jsp
<script type=text/javascript>
function doIt() {
if (navigator.appName.indexOf("Netscape") != -1)
window.location = "URL for JSPa";
if (navigator.appName.indexOf("Microsoft") != -1)
window.location = "URL for JSPa";
else{
document.location = "URL for JSPa";
}
}
onload=doIt;
</script>
 
vivek sivakumar
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi manohar,
Thanks a lot for that snippet code , it really works now !!! thanks once more for ur solution . will be back with some more problems
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!