Java 如何在eclipse项目中编译和运行单个jsp文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22246015/
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
How to compile and run individual jsp file in eclipse project
提问by Sharab
I am working on web application project and it have many jsp files. If I do any modification on particular jsp file, I need to give whole build and I have to check the appropriate changes in that JSP file. { I have tried to run jsp on server it shows like resources are missing.}
我正在开发 web 应用程序项目,它有很多 jsp 文件。如果我对特定的 jsp 文件进行任何修改,我需要提供整个构建,并且必须检查该 JSP 文件中的适当更改。{ 我试图在服务器上运行 jsp 它显示资源丢失。}
Please let me know is there any way to compile and run individual jsp file in eclipse project which can show the changes instantly without whole build project.
请让我知道有什么方法可以在 eclipse 项目中编译和运行单个 jsp 文件,它可以在没有整个构建项目的情况下立即显示更改。
回答by Shriram
It is possible. Right click on the specific jsp file and click run on server. But make sure there is no dependencies from previous file.
有可能的。右键单击特定的 jsp 文件,然后单击在服务器上运行。但请确保没有来自先前文件的依赖项。
回答by Santhosh
As you say JSP files run on the server , so they need a server to run . They can't be run individually from the application since they might have a application flow (i.e. dependencies with previous files).
正如你所说的 JSP 文件在服务器上运行,所以它们需要一个服务器来运行。它们不能从应用程序单独运行,因为它们可能具有应用程序流(即与先前文件的依赖关系)。
You might try using the browser tools like Firebugto make UI changes in your pages,
您可以尝试使用Firebug等浏览器工具在页面中更改 UI,
Make note of the changes
Fix it as a whole
记下更改
整体修复
Then Clean and build.
然后清理并构建。
Another option to enable build automatically . see here
自动启用构建的另一个选项。看这里
Hope this helps!!
希望这可以帮助!!
回答by jmail
you just goto use this link and see the image wise jsp run:
您只需使用此链接并查看图像明智的 jsp 运行:
Note: its all of the to same one in different website.
注意:它在不同的网站上都是相同的。
Another one sample:
另一个示例:
1.Right click>Run as>Run on server>choose an exiting server>next>add(your project)>finish.
2.Right click>Run as>Run on server>finish.