How to organise Spring project [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm vey new to developing in Spring.
I want to develop a project, but I don't know how to structure it.
I want to develop an application that I can use on the web and on mobile.
A app eqaul to mine idea would be this stackoverflow website.
I want everything to be visible on the web, but i want to develop a mobile application that can accces/edit the data.
I hope someone can give me a idea.
Thanks in advance!

This is not really a Spring question.
What you want is a REST API and two clients : a webapp and a mobile app (or just a responsive webapp which fits on mobile devices).
The REST API as well as the clients could be written with any framework. I don't know if Spring has mobile built-in features.
EDIT
You can have 2 controllers within the same webapp : one controller serving request at URI /rest/... for example and another controller serving JSPs for the web.
Or even as you stated a single controller which return HTML (via JSP) or JSON depending on the request.
Have a look at http://spring.io/blog/2013/05/11/content-negotiation-using-spring-mvc (old link, there might be a newer up to date link..)

Related

Design an application with multiple request sources: WS(SOAP\REST), MQ, batch [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have to design an application which gets requests from multiple sources like Web service (can be SOAP or REST), online system, Message Queue or some batch job. Application needs to interface with 2 more applications for getting results. I understand that this can be done using microservices. This application needs to be built in Java. I am looking for some framework which can help me with accepting input from multiple sources as mentioned above.
If you want to build a lightweight simple layer (single app) to cater all these requirements, I would recommend using Apache Camel. This single app can listen to rest/soap requests, read from file system, JMS store, database etc. You can even embed it into another application and have all sorts of integration with different data source and excellent and easy to configure routing and transformation engine. Plus the documentation and community is awesome.

How to communicate Front End( in C#, HTML, JQuery) with Backend( JAX-RS( Jersey) and JAVA)? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to develop a Web application in which front end will be developed in HTML, C#, ASP.net and server side will be using JAVA ( JAX-RS jersey ).
So, the front end will be running on IIS server and java will be running on Tomcat server.
How to consume Java REST API from C#?
I mean is there any way to to communicate between two different servers ?
Note: This is my second time asking question on this platform, so I am sorry if my question doesn't make any sense.
Perhaps you can look into using the Spring framework. With the Spring framework, you can build a RESTful web service that has end-points with which your front-end can communicate. It works like the C# Web-Api, in that you can define a "base URL" and other specific URLs that you can link to a function in your Java code.
Spring website:
https://spring.io/
Some help to getting started:
http://www.journaldev.com/2552/spring-rest-example-tutorial-spring-restful-web-services

Enabling a completed Java app on the web [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am not a Java pro. I need to enable my completed java applications to ONLINE-Versions. Kindly give me the simplest way.
I have tried to go the JSP and Servlet way, but seems exceedingly tiresome,there surely ought to be a direct way.
When you use a typical web application what do you think is happening? You're in a browser and it's displaying some pages. You click around and some server does some work, for example Amazon shows you a list of books you could buy, the server is passing data to the browser for it to display.
That's a big difference from your current Java Application where everything is happening in the same computer.
This split between the UI part of the application, in the Browser, and the server part that's doing the real business is one reason why Web programming is so different from simple Java programming.
Servlets and JSPs are the traditional Java way of doing things, but modern web apps make much greater use of JavaScript for all the UI and all the Java (or any other server technology) does is provide the data displayed by JavaScript.
Bottom line: Sorry, but there is a whole lot more to learn. My recommendation would be to grit your teeth and forget about what you've done so far and start studying JavaScript and HTML.

Please suggest approach for Java-based web app [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm a Java developer that hasn't coded in about 5 years and wants to polish up my skills. I am going to create a small app that uses an OAuth 2.0 authentication flow and then makes a few REST calls and displays the results. I've got my credentials setup with the OAuth provider.
I used Eclipse back in the day, is that still a solid IDE for this type of project? If I want to share the app with others to show my work, where could I host the code?
Thanks for these and any other pointers.
first off - yes, Eclipse if still a good choice.
if you can, make you app a web-application, and then you can host it in PaaS such as Google AppEngine. then the app itself will be always accessible from any machine that is connected to the web. this way, you will be able to show it to anyone you want.
if you only want to show the code, then GitHub or Google Code are a good choices.
HTH

Web services(SOAP based/Restful) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to learn Java WebServices. I read couple of articles on IBM developer works but I think I am getting confused about where to start. My main interest is Restful webservices. Where can i start from? I also prefer book with web service development example based on eclipse platform.
I always find very useful response from this site and always respect the people who responds to all these questions, so as always this time too I am expecting top answers.
Thanks a lot
The Spring Framework has great support for RESTful web services in java. It is a huge library for web development in Java so it might be a bit heavy handed. However, in my experience you eventually end up needing a lot of what's provided by Spring whether you plan on it or not.
http://static.springsource.org/spring/docs/current/reference/mvc.html
So with Spring Web MVC, you can create web controllers that handle requests in a really clean way, something to the effect of (but not tested for exact correctness):
#Controller
public class PetController {
#RequestMapping("/pets/{petId}")
public void findPet(#PathVariable String petId) {
// implementation omitted
}
}
In terms of learning about RESTful web service design, I'd suggest RESTful Web Services by Richardson, Ruby, DHH.

Categories