登录后菜单栏不显示 - Shenzhen Java User Group

在登录EBS系统时,输入用户名和密码后点击登录之后跳转至职责菜单界面后,弹出弹出窗口提示:Unable to generate forwarding URL ,菜单栏职责都不显示。强制关闭浏览器重新登录后,可以正常使用系统

Related

how i can get the "referal url"

hi
how i can get request page url i.e. referal url
in jsp 
request.getHeader("referer");

URL on servlet

I have a servelt called "/order", it will process some data, after it finish processing those data, it will do this:
---------------------------------------------
target = "/order.jsp";
RequestDispatcher rd;
rd = getServletContext().getRequestDispatcher(target);
rd.forward(req,res);
---------------------------------------------
which I want to forward the paget to "/order.jsp", a jsp page, not a servlet.
But after the browser forward to new jsp page, the URL will not change to the jsp's address(in this case,"order.jsp"), it still shows the servlet URL.
What should I do to make browse shows current page URL?
Thanks 
what kind of mapping are you using for your servlet.
Post what you have inside <servlet-mapping></servlet-mapping> tags 
This is what I have.
<servlet>
<servlet-name>order</servlet-name>
<servlet-class>OrderServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>order</servlet-name>
<url-pattern>/order</url-pattern>
</servlet-mapping> 
The browser makes a request to the order servlet. On the server the order does a forward to the order.jsp which then returns to the browser. But the browser has no knowledge of what occured on the server so will display the url that it sent the request to which is the order servlet.
The only way to get the browser to dispaly the order.jsp url is to do a sendRedirect or the html/javascript equivalent.
However before you do that ask yourself the question: what happens if the user bookmarks the order.jp url? If the user were to go directly to order.jsp can the jsp handle it gracefully?

Rediect particular URLs to index page

Hi,
From Apache1.3, I have to redirect all the URLs coming from port http://mydomain.com:9001/servlet/* to a index page (index.html).
I tried giving "Redirect" directive under mod_alias
Redirect /servlet http://mydomain.com:9001/index.html
but it is looking for http://mydomain.com:9001/index.html/* and is not redirecting it to the file. How can I do this.

Redirect

What is the difference between request dispatcher and sendRedirect? 
requestdispatcher works on the same request object. i.e you can forward the request object to some other servlet to handle and generate the response.
use this when you want to include in your response the response of some other servlet/jsp or if you decide that the request should be processed by some other servlet/jsp altogether.
sendredirect on the other hand tells the client browser to send a new request for the indicated web resource. This is used when you want to link to some external web resource which is not in your web-app
thus, in case of requestDispatcher, no new request is issued by client (that's why the url in the address bar does'nt change).

Redirect to http://...  www URL

Can anybody tell me how to do the redirect to a www URL in a servlet? I used the following which worked for redirecting to a servlet or jsp. It didn't work for "http:...".
ServletContext test_sc = getServletContext();
RequestDispatcher test_rd = test_sc.getRequestDispatcher(url);
test_rd.forward(req,res);
Thanks,J 
You can't "forward" to an external URL.
Use response.sendRedirect

Categories

Resources