使用 Tomcat (Eclipse) 调试 GWT 应用程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4848198/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Debug GWT Application with Tomcat (Eclipse)
提问by Ashfak Balooch
I have tried to deploy the application with tomcat and I am succeeded. Now instead of internal GWT server I need to set tomcat as default inbuilt server and debug my application with it. The problem here I am facing is I am able to upload file into hosted mode successfully but when I tried to deploy my application to tomcat it gives me error to Struts interceptor.
我尝试使用 tomcat 部署应用程序,我成功了。现在我需要将 tomcat 设置为默认的内置服务器并用它调试我的应用程序,而不是内部 GWT 服务器。我在这里面临的问题是我能够成功地将文件上传到托管模式,但是当我尝试将我的应用程序部署到 tomcat 时,它给了我错误的 Struts 拦截器。
ERROR ParametersInterceptor.setParameters():242 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'fileUploadContentType' on 'class com.example.server.actions.FileUploadAction: Error setting expression 'fileUploadContentType' with value '[Ljava.lang.String;@12569b8'
ERROR ParametersInterceptor.setParameters():242 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'fileUploadFileName' on 'class com.example.server.actions.FileUploadAction: Error setting expression 'fileUploadFileName' with value '[Ljava.lang.String;@13fb1ab'
I request you suggest me the solution to this issue or redirect me on how to debug with tomcat in eclipse (GWT).
我请求你向我建议这个问题的解决方案,或者重定向我如何在 Eclipse (GWT) 中使用 tomcat 进行调试。
Can anybody redirect me on this issue...
任何人都可以在这个问题上重定向我...
Any help is much appreciated.
任何帮助深表感谢。
Thanking you,
感谢您,
Regards
问候
回答by Xorty
It's really easy, just follow these steps:
这真的很简单,只需按照以下步骤操作:
- Get google plugin for eclipse
- The in eclipse, right click on your project and choose Debug as -> Web Application (running on external server)
- Enter URL of your web app on tomcat (like http://localhost:8080/YourApp/YourApp.htmland eclipse will give you new one - it will add stuff like ?gwt.codesvr=127.0.0.1:9997
- 获取Eclipse 的谷歌插件
- 在 Eclipse 中,右键单击您的项目并选择Debug as -> Web Application (running on external server)
- 在 tomcat 上输入您的 Web 应用程序的 URL(例如http://localhost:8080/YourApp/YourApp.html和 eclipse 会给你一个新的 - 它会添加类似 ?gwt.codesvr=127.0.0.1:9997 的内容
And that's it. Just set up your breakpoints and debug!
就是这样。只需设置断点并调试即可!
回答by Naoj
Have you tried to configure your struts.xml file to exclude parameters that seem to cause problem?
您是否尝试配置您的 struts.xml 文件以排除似乎会导致问题的参数?
<interceptor-stack name="defaultStack">
<interceptor-ref name="params">
<param name="excludeParams">fileUploadContentType,fileUploadFileName</param>
</interceptor-ref>
</interceptor-stack>