I am trying in Springboot mvc for some time and have a problem:
my app auto generates List of Commentaries. I'd like to show them one by one on website.
I know there is solution in js but dont know yet a lot on js. trying first in java/spring.
I found js solutions on stackoverflow but hard to me to implement them to my app - idk how/where to put js script in template nor js function in controller/service.
guys, could you guide me with the simplest solution?
Related
Does anyone know if it's possible to process a JSP page from within Java code and get the resulting HTML string?
I'm working on a project that has a Spring Boot application. One of the requirements is to have an end point that returns JSON. The JSON is suppose to contain one or more properties that contain HTML strings that were generated by JSP templates. The JSON will contain other other properties as well.
I've done some research and I've found examples showing how to process Freemarker and Thymeleaf templates from within Java code. However, I've been unable to find any examples showing how to do this with JSP. Ideally we would like to use JSP as that's what our developers know and in the interest of time there would be no learning curve as opposed to if we went with Freemarker or Thymeleaf.
Has anyone out there done this before with JSP?
As an application to get a job I need to make a web app. I'm only familiar with Java SE so here comes my concerns. I need to make web service where at the beginning there will be authentication window, then I need to show the JSON data (probably parse it and show) as table or as list with button near to choose one of the row from the table to get to the next page where there user can choose a materials and so on.
I have data in JSON on server I need to pull it from there, then I need to show data which looks like this /materialDetails?ID=x where x is ID (it's probably HTTP or URI). Should I use Java REST? If yes I need to create a site in XML and then put java data inside? There're only a few tutorials on the internet and I can't find any good(sometimes the problem is in server, sometimes with dependencies). I was looking for information also on youtube but except https://www.youtube.com/watch?v=X36Dud8cS4Y I cant find anything useful? Could someone explain me this to make it at least a lil bit easier? Or just lead me to pick a specific framework. Thanks in advance
You could create a Dynamic Web Project with Tomcat and a MySQL Database for starters. You could use RESTEasy to create a WebService that gets data from your Database.
I don't know what exactly is expected from you, but this might be a good start. "Making a web app" is a bit like saying "I need to develop a java program", it is a bit vague !
I don't know REST but I think your application can be implemented with this technologies: HTML and Servlets/JSPs.
I would write an authentication page in HTML (one form element with 2 inputs and a button) which would pass credentials to a Java Server Page or a Servlet (they're equivalent). There I would build the table (another HTML element) thus producing a new HTML page.
P.S.: you're using JSON as a format so there's no need to learn XML.
I have simple project with spring security, i taked it from mkyong.com.
I put it to GitHub repo (mySource).
Pages in this project - jsp.
I want to remake this functional to angular (authization and welcome page), and escape from jsp.
I want do it as simple as possible.
Help me, please! Thanks!!
As you did not shown any of your effort so far so as an idea I can suggest you to use Thymeleaf pages instead of JSP in same project. And then you can simply apply angularJS code in Thymeleaf pages. You can get the idea from this repository.
I need to access HTML elements from my Java program based on the id or className of the element (like getElementByID or getElementsByClassName). I also need to be able to click a few buttons on the page.
Main Points:
I am creating a desktop application. It is not a web app.
I need a browserless solution
My code needs to auto fill a form and submit it without opening a page.
Are there any libraries out there that could suit my needs, or could I achieve this in plain Java code? If my question isn't clear please let me know and I will try to explain it in a better way. Thank you.
Selenium is a library used for scraping html elements using java. It is often used for testing. There is another library called Vaadin. It is used for doing front-end work on the back-end using java. It is similar to Java Swing but used on the web. Hope this helps!
I am going mad trying to find an example of file upload code in Java that will enable me to submit (POST) images to a URL from a JApplet in the same manner that an html form would post a multipart form. I have found loads of examples referencing servlets, jsp, apache but this is no good to me as my applet is being displayed in a Microsoft MVC 2 .Net project on IIS 7
Surely there has to be a simple way to do this - I am using jnlp/webstart and have no issues accessing the files I want to upload I just can't seem to find a simple sample to get me underway.
Any feedback/tutes greatly appreciated, I am happy to be pointed in the right direction in regards to the appropriate Java classes/methods - this will at least give me a starting point.
Cheers
Rob
Short Pointer: Use URL, URLConnection, setDoOutput(), and getOutputStream().
Actually it got the better of me and starting googling again but this time for Java Submit Form rather than Java File Upload and I found this great class that I have just confirmed works correctly with great abstraction of the painful intricacies of this process.
http://www.devx.com/Java/Article/17679/1954