Use Webstorm with Tomcat

I am attempting to build a dynamic website with WebStorm and IntelliJ


On IntelliJ, I have a Tomcat server with several servlets that return JSON.

I have started building my front end on WebStorm and have some AJAX calls.

In order to have AJAX calls from the front end to the back end, they both need to be on the same port (without cross-origin support, which would not be appropriate to enable). However, I get a message saying that WebStorm cannot work on a port that is in use.

Though I like its features, I cannot justify continuing to use WebStorm to develop this site unless I can easily test client server interactions.

Is there a way to set up integrated testing between client and server with these two IDEs?

[edit]Is it possible to set WebStorm to automatically deploy (unarchived) to the folder that contains the exploded WAR in the IntelliJ project? I think that might work[/edit]

Message was edited by: Donald Subert

7 comments
Comment actions Permalink
However, I get a message saying that WebStorm cannot work on a port that is in use.

when do you see this message? Please attach screenshot.
Also, can you do what you want without using WebStorm/IDEA? I mean running your application not from within the IDE?

0
Comment actions Permalink

Here is a screenshot of what is going on when attempting to run (first) IntelliJ and then change Webstorm to use the port that IntelliJ is running tomcat on. This change is made in Settings > Build, Execution, Deployment > Debugger > Built-in Server Port

If you zoom in, you can see the message in theupper right corner that says: "Built-in-HTTP server on custom port 8080 disabled; Cannot start built-in HTTP server on custom port 8080). Please ensure that port is free (or check your firewass settings) and restart WebStorm.
WebStorm port already in use.png
The suggestions in that message are not all that useful because the port is in use and must be in use already to attempt what I am attempting.

It is, of course, impossible to run 2 webservers on the same port, with different webroots. I was hoping that JetBrains might have figured out that somebody might be interested in building both the front end and the back end of a website (you know, for a laugh), and make a way to have WebStorm and IntelliJ use the same webserver, or deploy to the same WAR.

As to your second question. I have not yet been able to figure out how to deploy a non-archived Tomcat project outside of an IDE. I am continuing to reasearch that.

0
Comment actions Permalink

Okay. I have just figured out how to deploy the non-archived version of the WebStorm and IntelliJ project contents to a Tomcat webapp (outside an IDE) and run it. It works fine.

So we know that the two parts  work together. However, I do not get to use the IntelliJ debugger when it is run this way.

0
Comment actions Permalink

Of course, 2 webservers can't be run on the same port, and I don't understand what you expect from WebSt
orm here

and make a way to have WebStorm and IntelliJ use the same webserver

and why  do you use WebStorm built-in web server then? Use Tomcat - what's the need to run a different webserver if you do have the one already? Just specify the corresponding URL in your javascript debug run configuration you useu for client-side code debgging - http://confluence.jetbrains.com/display/WI/Starting+a+JavaScript+debug+session#StartingaJavaScriptdebugsession-Startingadebugsessionwhenusingadifferentwebserver

0
Comment actions Permalink

lena_spb wrote:

Of course, 2 webservers can't be run on the same port, and I don't understand what you expect from WebSt
orm here


I think I already explained that my expectation is that there to be a way, internally, to deploy to the same server or WAR.

It is, of course, impossible to run 2 webservers on the same port, with different webroots. I was hoping that JetBrains might have figured out ... a way to have WebStorm and IntelliJ use the same webserver, or deploy to the same WAR.




Using Tomcat is what I am doing now and it sucks. It takes too much time to manually port over all the files from the project each time there is a change. I am hoping that WebStorm can add some automation here. If I could press a button and deploy the unarchived into the directory for my Tomcat server, that would save quite a bit of time. For that matter, why not deploy it straight into the compiled webapp in the IntelliJ project? The main issue is the time that I lose if there isn't an automated way to do this.

0
Comment actions Permalink

WebStorm provides no support for app servers deployment. If you need a way to create WARs and deploy them, Webstorm is the wrong choice - you need  IDEA

If I could press a button and deploy the unarchived into the directory for my Tomcat server, that would save quite a bit of time.


'Simple' deployment (transferring files to a different folder) is supported - see https://confluence.jetbrains.com/display/PhpStorm/Deployments+in+PhpStorm. You can set up auto-deployment to have files uploaded on each change, or deploy them manually using Deployment | Upload to <server name>

0
Comment actions Permalink

Hi I think I have your answer you can run your app is debug mode in intelij then set up webstorm to do remote javascript debug then you can debug the call all the way. 

0

Please sign in to leave a comment.