开发者

Recomendation tech for adding web to a java application [closed]

开发者 https://www.devze.com 2023-01-10 04:30 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_JS百科

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 8 years ago.

Improve this question

I am new in web development world (from microcontrollers to web is a really long path)

Having a Java software (.jar) running, it's just a background process sending/receiving info through sockets, with no interface.


I would like to make a web interface to it, and I need some guidelines, about how to confront these topics


The code:Should I keep it being .jar or it's recomendable to go into .war and deployment? other?

The html/javascript code:Edit the page with an wysiwyg editor? and/or edit the html code within IDE ? / use GWT to develop everything within java? other?

The http server: Use an Apache Server, tomcat? implementing it within java with HttpHandler? other?

The Data: Data is actually in classes, objects and some persistence with writeObject.. should I leave it that way or "web development" is compatible better with mysql or some sql? other?


Just searching for something simple and actual tools, and to avoid reinventing wheels

Experienced web developers, your advices are very welcome!


I would suggest that you embed Jetty and then add some servlets to connect your existing code.

It really works !


If this is an accurate summary

 You have a (presumably) proprietory protocol exposed over a socket interface.

 You desire to access the same function over HTTP, with a Browser based GUI.

Then I would approach it like this:

1). Consider whether to refactor your current code - In concept you have a "core" with a socket interface. What you need is the same "core" with an HTTP interface ... except maybe that doesn't nicely work? HTTP is effectively stateless, with request/response pairs. You might have something much cleverer with your sockets so some redesign might be needed, or maybe it just fits, or even you need to get really clever and use streaming, or Comet or something.

So first decide on an approach. Let's take the optimistic assumption that a standard HTTP model works for you. Then:

2). You may as well use the servlet API, so TomCat or WebSphere Community Edition or any readily acessible servlet engine will do. Just write a few servlets that front your "core".

3). Tools, Eclipse works. Plenty of alternatives, but favour an IDE.

4). Especially when moving to the UI part, editing HTML, or JSPs something WYSWYG is useful. Things get a bit tougher if you want to do a Javascript-based UI - there are products out there but I don't think they're as mature as things such as Eclipse for Java.


I recently learned Spring. It's a very lightweight framework, and very easy to learn and use.

0

精彩评论

暂无评论...
验证码 换一张
取 消