Often when I see index.jsp in a web application, it just goes to another url like login.jsp like
<jsp:forward page="login.jsp" />
When using struts2, I need a similar index.jsp, but I want it to go to action. How to do it?
You can use plain HTML if you want
Between your tags use:
<META HTTP-EQUIV="Refresh" CONTENT="1;URL=Login.action">
This will be redirected to myCOntext / Login.action
If Login is outside the namespace, you need to include it in the URL
scriptlet:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% response.sendRedirect("/Project/namespace/Login.action"); %>
I use it with Struts2 and it works.
Try the following:
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=welcomeLink.action">
It is also a worker,
<% response.sendRedirect("welcomeLink.action"); %>
But in my experience, it will only work when it is on the index page or on any other page that loads as the first page.
If I put response.sendRedirect on any successor page, this will not work. Extract this question
Source: https://habr.com/ru/post/1314832/More articles:Scheme Quickgraph / Graphsharp nodes from left to right - graphHow to download links from a site using Perl? - perl502 Bad Gateway Error Occurs Suddenly - htmlHow to create PHP SOAP Client to call WCF web service under SSL? - soapUnable to access WCF in IIS from PHP SOAP - soapActiveSupport uninitialized constant :: Cache :: MemCacheStore :: MemCache - ruby-on-rails-3Regular expressions in java with a variable - javaHow to convert a country string to its ISO 3166-1 code using Zend? - phpproblem with selectors "Button" and ": button" - javascriptReturning links from C ++ methods - c ++All Articles