提交后 JSP 页面从浏览器中消失

发布于 2024-12-23 09:04:11 字数 1696 浏览 2 评论 0原文

这是我第一次使用 struts (1.2)

在我的 jsp 页面中,我有一个表单,用户需要提供 IP 地址和文件名,一旦他提交页面,该数据就会传递到一个连接到的 Web 服务设备并收集给定文件名中的数据。

现在的问题是,当我在一段时间后使用按钮提交页面时(在 IExplorer 上大约 1-2 分钟,在 Firefox 上大约 4-5 分钟),我的应用程序页面消失了;我在应用程序日志或 weblogic 日志中没有看到任何错误。

这是一个同步请求,用户必须在 UI/网页上等待最终结果显示,大约需要 30-40 分钟 下面是 struts-config.xml 中的片段

    <action 
        path="/Collect"
        type="com.aqura.project.struts.fileMgt.CollectResultAction"
        validate="false">
          <forward name="Collect" 
                   path="/jsp/collect.jsp"/>
    </action> 

    <action
        path="/CollectDisplay"
        type="com.aqura.project.struts.fileMgt.CollectResultAction"
        name="collectForm"
        scope="request"
        validate="true"
        input="/jsp/collect.jsp">
          <exception
              key="exception.prodconn.error"
              type="com.aqura.project.service.prodConnect.ProductConnectException"
              path="/jsp/ctError.jsp" />
          <forward name="FileTransferDisplay"
                   path="/jsp/fileTransferDisplay.jsp" 
                   redirect="true"/>
          <forward name="FileResolve" 
                   path="/FileResolve.do" 
                   redirect="true"/>
    </action>

。collect.jsp 是此操作的 jsp 文件,用户必须在此页面上等待,直到我们成功获取文件,一旦收到文件,我们将检查它是否存在并且需要将其删除。重命名,否则它将存储在用户 a/c 中。

逻辑写在 CollectResultAction.java 上,我们在其中映射了操作。

在过去的一周里,我一直在为这个问题苦苦挣扎,却一无所获。

我尝试使用 <%c:out /> 在 JSP 上放置一些日志 但这也不起作用。我不知道如何调试这个问题。任何帮助将不胜感激。

另一个更新: 我在.jsp文件中添加了html刷新标签,现在FireFox页面上的此更改一直保留到显示最终结果,但在IE上我仍然看到这个问题,我已经尝试过IE6和IE8 。

This is the first time I am working with struts (1.2)

In my jsp page I have a form, user needs to provide IP address and filename, once he submit the page, this data is passed on to a web service which does connection to the device and collects data in the given file name.

Now the problem is, when I submit the page using the button after a while(around 1-2 minutes on IExplorer and 4-5 minutes on firefox) my application page disappear's; I don't see any error's in my application logs or weblogic logs.

This is a synchronous request and user had to wait on the UI/webpage for the final result display which takes around 30-40 minutes
below is the snippet from the struts-config.xml

    <action 
        path="/Collect"
        type="com.aqura.project.struts.fileMgt.CollectResultAction"
        validate="false">
          <forward name="Collect" 
                   path="/jsp/collect.jsp"/>
    </action> 

    <action
        path="/CollectDisplay"
        type="com.aqura.project.struts.fileMgt.CollectResultAction"
        name="collectForm"
        scope="request"
        validate="true"
        input="/jsp/collect.jsp">
          <exception
              key="exception.prodconn.error"
              type="com.aqura.project.service.prodConnect.ProductConnectException"
              path="/jsp/ctError.jsp" />
          <forward name="FileTransferDisplay"
                   path="/jsp/fileTransferDisplay.jsp" 
                   redirect="true"/>
          <forward name="FileResolve" 
                   path="/FileResolve.do" 
                   redirect="true"/>
    </action>

collect.jsp is the jsp file for this operation and user has to wait on this page until we get a file successfully, once file is recieved we will check if it exist and needs to be renamed otherwise it will stored in user a/c.

logic is written on CollectResultAction.java, where we have action mapped.

I have been struggling with this issue for the past one week, and not able to make anything out.

I tried to put some logs on the JSP using <%c:out />
but that also didn't work. I am not sure how to debug this issue. Any help would be appreciated.

Another Update:
I have added html refresh tag in the .jsp file, with this change now on FireFox page stays till final result is displayed, but on IE I am still seeing this issue, I have tried with IE6 and IE8.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

绝不放开 2024-12-30 09:04:11

您可能遇到了浏览器超时。将调试放入 JSP 中没有意义,因为您的操作会在 30 或 40 分钟后转发到 JSP。这种做法不太人性化,并且会使浏览器和服务器保持开放连接的时间过长。这可能就是您观察到这种行为的原因。

您应该在后台启动这个漫长的过程,并立即发送响应,告诉用户工作正在进行中。让这个页面每分钟刷新一次,或者每分钟触发一个ajax请求,以了解进程是否已经结束。

You're probably hitting some browser timeout. Putting debug in the JSP doesn't make sense, since your action forwards to the JSP after 30 or 40 minutes. This way of doing is not user-friendly, and makes the browser and the server keep an open connection for a too long time. That could be the reason why you observe this behavior.

You should start the long process in the background, and immediately send a response telling the user that the work is in progress. Have this page refresh itself every minute, or trigger an ajax request every minute, to know if the process has ended or not.

血之狂魔 2024-12-30 09:04:11

感谢 JB Nizet 的帮助。
我尝试通过每分钟添加刷新来解决 FireFox 上的问题,并且它开始工作,但是,我的应用程序对 IE 有很大的依赖性,并且我仍然在 IE 上看到相同的问题。

在这个问题上花了很多时间后,我终于找到了解决方案
问题出在IE上,需要将IE恢复出厂设置
以下是如何

在菜单栏中(如果您的菜单栏丢失,请右键单击 iE7 上主页图标附近的工具栏)单击 Internet 工具、高级选项......在底部您将看到 RESET INTERNET EXPLORER 。
继续点击那个按钮,你的痛苦(希望)就会结束。
此后我的互联网浏览器开始加载所有页面。

我找到了这个解决方案@ http://www.techsupportforum.com/forums/f56/internet-explorer-not-loading-pages-but-firefox-is-69617.html

感谢您的所有帮助。

Thanks JB Nizet, for your help.
I tried by adding refresh every minute by this I was able to solve the issue on FireFox and it started working, however, My application has lots of dependency on IE and I was still seeing the same issue on IE.

after spending lot of time on this issue, I have finally found the solution
the problem is with IE, and you need to reset IE back to factory settings
here's how

In the menu Bar (if your menu bar is missing right click on the tool bar near the Home icon on iE7) click on internet tools, advanced option.....and at the bottom you will see RESET INTERNET EXPLORER .
Go ahead and hit that button and your misery (hopefully) will end.
My internet explorer started laoding all pages thereafter.

I found this solution @ http://www.techsupportforum.com/forums/f56/internet-explorer-not-loading-pages-but-firefox-is-69617.html

Thanks for all the help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文