Java web application to use for testing of servers - java

I'm looking for a simple open source, or reference application that I could use for testing some Java servers. The primary server would be Tomcat, and the database backend is MySQL. Are there some reasonable sample applications out there that are fairly easy to get up and running with?
The ideal application would be fairly stateless in nature and be accessible without authentication so that it could be easily used for stress testing.

There are spring examples, PetClinic and JPetStore. In these links you can find some more applications.

Related

Vaadin application and react in the same server

I'm a bit confused about what server to use for contain both, a Vaadin application (java) and a react application.
I was using nodejs for contain my react app, now I developed my vaadin application (I've used jetty to test it out), but I want to combined them in the same server
Can I use Tomcat to contain both? How can I deploy React on Tomcat?
Can I use expressJs to contain both? How can I deploy Vaadin on expressJs?
Is there a better approach?
Thank you a lot.
You're to some degree comparing apples to oranges in this case. To directly answer you question: You can use Tomcat for both, but not Express.js.
Vaadin is an opinionated full stack framework. It explicitly covers both the part of the UI that runs on the server and the part that runs in the browser. The server part only works on the JVM, either through a servlet container such as Tomcat or deployed as a standalone process with an embedded servlet container using e.g. Spring Boot.
React a relatively agnostic client-side framework - it is explicitly designed to work with any server-side technology. It is often used together with server-side JavaScript (e.g. Express.js) because that allows the whole application to be implemented using only one language, but it is also very commonly used with a backend running with e.g. Java or C#. All you need on the server is a way of creating endpoints for accessing the backend logic. In the case of Java, the two most common solution nowadays is to do REST endpoints using Spring (either MVC or WebFlux) or JAX-RS (e.g. Jersey).

Developing app with web and Android client with Java

I'm going to start developing a new simple "X management" kind app, like contact management or events management. What I want to know is which tools would be the best to achieve it in the way I want.
My app needs to be a web app running on a server that has a mysql database to save and retrieve some simple information. This app must have a web client but I want it to be able to be extended to work with an Android app client.
Things I've thought:
I've worked on Java with facelets and JPA travels management app running on a GlassFish server on localhost with a JSF web view, so maybe my web client and the full app could be done with this.
I've worked with web services such as SOAP and REST with Jaxb and xml schemes to retrieve information parsing some webs into xml or json to show on a client .net app. So I've thought I can add to my app, like last topic we talked about, a REST web service layer to easily work as I want, or at least I think it would be easy. If I do this the Android app could share the same app core code but using the REST service.
My question is what could be the best way to do an app with 2 client side in different platforms that could share some code to be easy to extend it moreover to a desktop app. I've talked about these 2 options because I'm a students of computers at university and those are the tools I know, but I can easy learn more. I've also think about just a REST service and create a web and an Android client to work on same service or something like that.
This post is getting long, so here is the summary: What technologies and tools do you think are the best choice to create an java web app that needs to have web and Android client? Also what server, like tomcat, GlassFish or another, should I use? And what about persistence layer? JPA with mysql is the best I know to work with.
Thanks a lot.
P.D: I work with eclipse
From my point of view:
You can use java jersey and java spring both ( java spring as Dependency injection) for creating RESTful Web service. So, In server side you will create endpoint and you can access data from any platform through those endpoint.
Server can be anyone. It's up to you. I always try to use tomcat but tomcat is not a full JavaEE container it's only a servlet container. So if you want to use full JavaEE version then you should use Glassfish.
And yes JPA .It can be easily used in any environment supporting JPA including Java SE applications, Java EE application servers, Enterprise OSGi containers etc.
On the other hand, still choice is yours.

Issues with Creating application as a Web Service vs Regular MVC

I am working on a web application. The requirement is that is the future the application may also be used by other web application and mobile application.
My idea was the build the whole business logic layer as rest web service and build web client to consume this.
Later I can use the same thing in case I want to build a mobile client or give it to external parties. This saves me from writing a separate api code.
Is this the correct way?
Will it have any performance impact?
What is the primary reason of not adopting such an approach.?
I am using Java ,spring MVC,spring,hibetnate and Mysql as the development stack

Communicating "Internet Java EE" application with "Intranet Spring" application

We have two already running applications one is internet Java EE application and another one is intranet spring based application deployed in two different servers which need to communicate with each other for some functionalities.
1) What is the best way to communicate between these two applications?
2) In future after merging both functionalities, if we want to sunset one among these applications and make other use for both Intranet and Internet users what is the best suggesion to follow?
Option 1: Best option in my opinion:
Both the internet and intranet applications are running in your network. So take the libraries out of the spring intranet application and embed into the other Java EE application. There will be wiring required. If the internet application also uses spring for wiring then it should be smooth. Now all you have is one application running on same jvm. This might need time for integration and consolidation of data transfer objects.
Option2:
Within the intranet spring application create a wrapper service that exposes the service as a REST API. This should be quick to achieve and can serve as a short term solution. Later, use option 1 to merge them into a single application when you are ready. Another approach is to append modules in the intranet application into the internet application and expose the functionality.

Does iPad development work with interacting through Java code with Spring Framework using TomCat to host the web service on a server? How?

Here is the background of my situation:
I want to create an iPad application that interacts with a oracle SQL database. I have existing Java code from my Flex application that handles all the database requests, and modifications using the Spring Framework. The Flex Application ran as a web service through TomCat. Now I want to make that flex application into a mobile iPad version. I am having trouble figuring out what is the easiest way to use existing Java code and use it for the iPad because the iPad interacts using URL requests instead of direct with the Java.
My question is, can I use the existing Java code with the Spring framework to save time from coding all the back-end handling? Basically I want to access all the classes from my Java code by doing Requests from the iPad. Is this possible and will I need JSON or XML to interact between the iPad and the Java code?
Summary:
Can I use
iPad Objective-C <-----> Java (with spring framework) on TomCat Web Service to handle oracle SQL data handeling? If so, how and what technologies do I need? Will I need JSON or XML and how does that factor between the iPad and Java?
Thanks!
A good approach would be to design your app to communicate with RESTful services that return JSON. Once this is done your iPad app doesn't have to even know that the server code is written in Java.. it's just interacting over HTTP.
Here's a good tutorial on setting up your tomcat to host your RESTful services: http://www.vogella.com/articles/REST/article.html - I've used this for an app I'm developing. Spring isn't even necessary.
You could go XML, but JSON is just easier in my opinion. Here's a good blog outlining the good and bad of both sides. http://digitalbazaar.com/2010/11/22/json-vs-xml/
OK, I'm making the following presumptions.
Your flex application runs on a different machine from the Tomcat
server
Your flex application makes web service calls to the Tomcat server
So, the flex application doesn't know the underlying technology that provides the web services. It's just seeing/consuming the output
There's no reason why the iPad app can't do the same thing. There's no reason why it can't use the same web services that the Flex application uses. It could consume the same messages (Assuming it can handle the request/response format currently employed by the Flex application).
You can make changes if you like if you want to change the structure of the requests/responses between the clients. But the clients don't know (nor care) how the web services are implemented. They are just requesting and consuming info.

Categories

Resources