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.
Related
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?
I am trying to download data from the ajax based websites. But crawler4j doesn't support ajax crawling. I want to use crawler4j but with this functionality. My project is based on crawler4j. I there is any way to do please share link and snippet.
Check this pull-request by MadEgg - maybe this will solve your issue. You can also refer to the related issue on the project page to emphasize the need for AJAX crawling within the crawler4j framework.
I'am new to Java Spring MVC. Official documentation is very poor and i've got a lot of questions about rendering pages in Spring.
I have page and top block with menu. This menu must be dynamic and must be displayed on all pages. In PHP frameworks this is very common and very easy task. But Spring makes my brain explode.. How can i separate rendering of this menu in some peace of logic and tell spring to render it all the time? For example in JSP. Shoud I use beans or other stuff?
Thanks for your answers!
Official documentation is very poor
No it isn't. Its the one place I always refer back to.
I use a jsp include and yes pass a java bean to the jsp from the controller. The included jsp will be cached the first time it is included. In other places I connect to a controller using jquery and ajax, which dynamically updates the page.
I'd suggest the official tutorials, and krams as good starting points.
You won't find much information about this in the Spring documentation because it's out of the scope of Spring.
You can use JSP includes just as you would do PHP includes. This will however force you to repeat the page layout and the include in each and every page of the application :
<jsp:include page="/menu.jspf" />
Or use a templating engine, like Sitemesh or Apache Tiles (see http://static.springsource.org/spring/docs/3.1.0.RC1/spring-framework-reference/html/view.html#view-tiles for Tiles integration in Spring).
The easiest way would be to use <jsp:include page="/menu.jsp" /> where "/menu.jsp" is a path to your menu jsp.
There are other solutions like using tiles, but <jsp:include> should do.
I just wants to know that is it possible to integrate Displaytag with spring web mvc ?
If it is possible then can anybody please provide some tutorial or links for that ?
Thanks in advance..
A quick google for "DisplayTag Spring" suggests it works.
From DisplayTag with Spring
There is no extra configuration needed
to use the displayTag with Spring.
Just drop in the jar file to
WEB-INF/lib and start using it in your
jsps
From How to use display tag library in Spring MVC
Place these three jars under
WEB-INF/lib folder displaytag-1.2.jar,
displaytag-export-poi-1.2.jar and
displaytag-portlet-1.2.jar.
Before using it in your jsp you should
have the below line <%# taglib
uri="://displaytag.sf.net"
prefix="display"%>and now you can use
it how ever you want like
note - prefix uri with http.
Btw. a common problem that occurs
with Displaytag + Spring canned
*FormController is that onSubmit is (by default) only called on POST
requests. Keep in mind that displaytag
uses GET requests for sorting and
pagination (as it should), so you may
have to play with overriding the
isFormSubmission method in your
controller, if you want to handle
sorting and pagination in onSubmit
Can someone point to jqgrid + java web app solution or especially with populating the grid and sending the form back to server. there are several php examples but nothing on java.
If you want to use some advanced tools like Spring, Hibernate and Maven here is the good example.
http://krams915.blogspot.in/2012/01/spring-mvc-31-jqgrid-and-spring-data_1887.html
EDIT:
See this, if you want to use plain Servlet and JSP. This is very basic example.
http://javahunter.wordpress.com/2010/12/07/jqgrid-example/
Here is one example on the web:
jqGrid Forum: how-use-jqgrid-in-jsp-server-one-example
If you are using struts2 there's a plugin which includes jqueryui and jqgrid components.
http://struts2-jquery.googlecode.com/