我嘗試使用ADF中的導航規則的傳統方法,但它不起作用。可能因爲它是jspx
而不是頁面。導航到新頁面時獲取500錯誤代碼
嗯,我寫了上行動觸發按鈕點擊代碼:下面是bean類的方法的代碼:
FacesContext ctx = FacesContext.getCurrentInstance();
JOptionPane.showMessageDialog(null, "2", "InfoBox: " + "Info", JOptionPane.INFORMATION_MESSAGE);
HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest();
//Commented as authentication not required:
/* CallbackHandler handler = new SimpleCallbackHandler(un, pw);
Subject mySubject = Authentication.login(handler);
ServletAuthentication.runAs(mySubject, request);
ServletAuthentication.generateNewSessionID(request);*/
String loginUrl = "http://127.0.0.1:7101/ServiceCloudJavaApp/faces/ServiceRequests.jspx";
ctx.getViewRoot().getViewId();
HttpServletResponse response = (HttpServletResponse) ctx.getExternalContext().getResponse();
sendForward(request, response, loginUrl);
.........
}
private void sendForward(HttpServletRequest request, HttpServletResponse response, String loginUrl) {
FacesContext ctx = FacesContext.getCurrentInstance();
RequestDispatcher dispatcher = request.getRequestDispatcher(loginUrl);
try
{
dispatcher.forward(request, response);
}
catch (ServletException se)
{
JOptionPane.showMessageDialog(null, se.toString(), "InfoBox: " + "Info", JOptionPane.INFORMATION_MESSAGE);
}
catch (IOException ie)
{
JOptionPane.showMessageDialog(null, ie.toString(), "InfoBox: " + "Info", JOptionPane.INFORMATION_MESSAGE);
}
catch (Exception excep)
{
//JOptionPane.showMessageDialog(null, exep.toString(), "InfoBox: " + "Info", JOptionPane.INFORMATION_MESSAGE);
System.out.println("error:" + excep.toString());
}
ctx.responseComplete();
}
我收到網頁無法顯示! 錯誤代碼:500
錯誤日誌是here
難道你沒有更多的細節在服務器日誌? – Berger
錯誤代碼500意味着內部服務器錯誤。所以請從您的服務器日誌中提供完整的堆棧跟蹤。 – Anil
好的!我認爲我的代碼有問題,所以想先顯示我的代碼。我會在文本文件中發佈日誌並分享鏈接 –