weixin_33725722 2012-10-29 05:47 采纳率: 0%
浏览 39

重定向到AJAX URL

Have to redirect to the below URL:

AjaxView1?catalogId=12345&storeId=67890&List=123#AjaxView2?ListId=123&storeId=67890&catalogId=12345

I am passing this value as hidden prameter in form and redirecting from a java class. Somehow, the AJAX view is not being picked up. It is redirecting to the former AJAXView1.

Can you please suggest what I need to change so that it gets redirected to a second AJAX view "Ajaxiew2".

I would like to know, how will it handle the # symbol in the URLredirection.

EDIT

I have a form from where I am passing the hidden parameter value of URL.

<form name ="LogonList" action="someActionCode"  method="post">
<input type="hidden" name="storeId" value="67890">
<input type="hidden" name="URL" value="AjaxView1?catalogId=12345&storeId=67890&List=123#AjaxView2?ListId=123&storeId=67890&catalogId=12345 >
<input type="submit" value="Submit"/>

someActionCode will call a java class which will perform some business logic and after business logic gets executed, it will redirectURL to the URL passed as hidden parameter.

I would like to know, how will it handle the # symbol in the URLredirection.

  • 写回答

1条回答 默认 最新

  • 叼花硬汉 2012-10-29 10:27
    关注

    Passing second url as hidden value first do the firstURL work then do any one of the below.

    response.sendRedirect("/url2");
    

    or use this one based on the situation where you want

    String destination = "url2";
    RequestDispatcher rd = getServletContext().getRequestDispatcher(destination);
    rd.forward(request, response);
    

    or use this one based on the situation where you want

    String destination = "url2";
    RequestDispatcher rd = getServletContext().getRequestDispatcher(destination);
    rd.include(request, response);
    
    评论

报告相同问题?

悬赏问题

  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺