How to ask Spring Tool Suite (sts) to run a web application using Firefox? - spring-tool-suite

I am using Spring Tool Suite (sts) to develop a web application. When I test it by clicking "Run on Server", the Spring suite will open an IE inside its internal window area to run my application.
Can anyone tell me how to change the run property so that I can run my program using Firefox? Thank you.

Yes, you can configure that in the preferences. Go to "General -> Web Browser", select External Browser, and Firefox - and you should be ready to go.

I'm using "Spring Tool Suite 4"
Version: 4.9.0.RELEASE
You click: Window -> Reference -> (search Browser)
Choose the browser you want to build the project.

Related

Live debugging a Spring boot project in eclipse

I am trying to create a Spring boot based MVC application using eclipse.
I created a starter template from spring's starter website and i have imported the maven package into eclipse.
I created a controller and a view and I am able to run the application by going to "debug as" or "run as" and selecting Java Application and then selecting the spring boot application main method from the list.
However with this approach, Eclipse does not seem to auto build my changes in my java classes nor the changes in my template views. (I use Thymeleaf btw) on the fly even though "auto build" is switched on in eclipse.
This forces me to stop the application in eclipse and re run the application for every small change i make and its very difficult.
Is this the only way on eclipse or is there a better way for eclipse would auto build the java and template files on the way so that I can code and debug simultaneously.
Eclipse is most likely compiling because that's what Eclipse does, but maybe you need to install the dev tools so that you get live reloading enabled.

Running GWT on tomcat in eclipse

I am trying to get a GWT Project running on a Tomcat 7 server in eclipse. I installed Tomcat and i can run other web application out of eclipse on Tomcat without a problem.
Now i generated a gwt maven project for eclipse with the following command and importet it as maven project to eclipse:
"mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin"
I can run this now as Web application (with the google plugin) and i can build a "war" with maven and deploy this with the Tomcat management console on the server. Both is working. But if i choose the option in eclipse "Run on server" and choose tomcat than just the html is loaded but not the application itself. See the screenshot: It doesn't find the "GWTModule.nocache.js".
This file is available in the target folder. What do i have to change to tell tomcat to look in the correct directory?
Tomcat is not able to run GWT code in development mode. You can use Tomcat for server side code, but in this case you need to run GWT development mode with -noserver option (to prevent built-in Jetty instance from running). See this article for more details.
I would recommend using the wtp plugin for eclipse. If you do this you can add your project/resource to tomcat when adding a new server. Here are the steps to use if you already have your project imported into eclipse.
Window -> Show View -> Servers
In Servers
New -> Server -> Choose apache tomcat
Point to the location of your tomcat installation/download
Next
At this point you should be able to add your gwt-maven project which will add the target/project.war to the tomcat modules.
Save it
Click on the newly added server, then click the modules tab at the bottom kind of hard to see.
This should have your project shown in the list of web modules.
Start your tomcat instance then on your gwt application right click and choose Run As -> Web application. Make sure your configuration settings are correct and when the development server starts it should give you the development url to browse to.
You can configure some aspects of tomcat in the overview tab, I would recommend making sure that "Modules auto reload by default" is checked so that tomcat will watch the filesystem for class changes.

Code Coverage in Web Applications (Wicket)

I am using Apache Wicket as my web application framework in Eclipse.
Currently I have eCobertura as an eclipse plugin installed.
But it needs a main() method to run. I do not have one.
So how can I run code coverage within a web application?
Regards...
Or you can try out EclEmma, it is available in the Eclipse Marketplace and is really easy to use. It gives you a right click option on your project, package or file: "Coverage -> JUnit test".
I use it with Wicket and you don't need any running server or such to run the tests.

Deployment of Web Application with ECLIPSE

I have developped a web dynamic application using JSP and servlet and I want to deploy it.
How to do it with eclipse.
how to do to launch the application.
Thanks for help.
Try Tomcat to deploy your application. You can easily integrate Tomcat into the Eclipse.
http://www.eclipsetotale.com/tomcatPlugin.html
Alternatively, instead of plugin, you can add the server into the Eclipse.
Ctrl -N > Server > Select Tomcat Server adapter
If you've developed your application as 'Dynamic Web Project' in Eclipse, the above process will detect your application, and asks you to select if it has to be deployed in the new server configuration.
To generate war file, right click on your project in 'project explorer' window, and click 'export as'. In the dialog box, select WEB > WAR file

Setting up Spring and Tomcat in eclipse?

I am having some trouble getting Spring and Tomcat up and running and recognized by eclipse. I have looked around on google with no luck. Specifically, I am having trouble having eclipse recognize tomcat (I am running linux, and when I browse to the relevant jar file in the runtime environments configuration, eclipse wont allow me to select it). Could somebody please point me to (or describe here) how to get Spring and Tomcat working properly in eclipse and possible provide a "Hello World" example so I can test my first Spring application? Thank you very much.
Have a look at the Spring Tools Suite - essentially Eclipse with Spring specific extensions.
You must have WTP (Web Tools Platform). It is bundled in the Java EE version of Eclipse
Go to Window -> Preferences -> Server -> Runtime environment and click "add"
Choose and setup your server following the wizard
When finished, Go to Window > Show view > Other and locate Servers
It will appear in the bottom panel. Now you can double-click it to set some options of your preference
Right click your project > Debug > Debug on server (The project must be a "web project")
It's generally this. There might be some troubles in the last step, but use google or the link given by Chris for that.
Not familiar with Spring, but here's a link that helped me get Tomcat up and running in Eclipse:
http://www.windofkeltia.com/j2ee/wtp-tutorial.html
you can try eclipse web tools platform for doing this.
You can go to your project then choose
Debug As --> Debug On Server
I think the server adapter for tomcat is installed by default.
You can download the Java EE Distribution Of Eclipse to have this functionality out of the box.