can someone help me with spring boot project thst have rest controllers and need to have 2 jsp pages

18 Replies
JavaBot
JavaBot2y ago
This post has been reserved for your question.
Hey @Stefan Adamovic! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st2y ago
What exactly is the issues? Deployment? Also are you sure about using JSP in Spring?
Unknown User
Unknown UserOP2y ago
Message Not Public
Sign In & Join Server To View
dan1st
dan1st2y ago
What specifically are you looking for? Yes, you can use JSP but Thymeleaf or similar probably works better
Unknown User
Unknown UserOP2y ago
Message Not Public
Sign In & Join Server To View
dan1st
dan1st2y ago
well you don't have to use JSP, right? it just sais like JSP It will likely be easier when using Thymeleaf or similar but if you want to, you can also use JSP
dan1st
dan1st2y ago
Baeldung
Spring Boot With JavaServer Pages (JSP) | Baeldung
Learn how to build a web application with Spring Boot and JSP.
dan1st
dan1st2y ago
But note that with JSP, you cannot deploy yur application as a JAR as stated here: https://stackoverflow.com/a/74459458/10871900
Stack Overflow
How to use JSP in Spring Boot
Configured Spring Boot according to a guide, still it cannot find my jsp views. So after launching I get this message "This application has no explicit mapping for /error, so you are seeing t...
Unknown User
Unknown UserOP2y ago
Message Not Public
Sign In & Join Server To View
dan1st
dan1st2y ago
Now do you want to use JSP or not? You can do whatever you want and I can probably help you in both cases
Unknown User
Unknown UserOP2y ago
Message Not Public
Sign In & Join Server To View
dan1st
dan1st2y ago
I would use one of the template engines in the above link/image and yeah ok I think I can now go to a VC
Unknown User
Unknown UserOP2y ago
Message Not Public
Sign In & Join Server To View
dan1st
dan1st2y ago
http://localhost:8080/mvc/shop/v2/products
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jakarta.servlet.jsp.jstl</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jakarta.servlet.jsp.jstl</artifactId>
<version>3.0.0</version>
</dependency>
Sort.by(Sort.Direction.DESC, "colName")
List<Product> findAll(Sort sort, Pageable pageable)
List<Product> findAll(Sort sort, Pageable pageable)
CrudRepository -> PagingAndSortingRepository yourRepository.findAll(PageRequest.of(page, limit, Sort.by(Sort.Direction.DESC, "colName")))
public interface ProductRepository extends JpaRepository<Product, Long>, CustomProductRepository {
public interface ProductRepository extends JpaRepository<Product, Long>, CustomProductRepository {
change that to
public interface ProductRepository extends JpaRepository<Product, Long>, PagingAndSortingRepository<Product, Long>> {
public interface ProductRepository extends JpaRepository<Product, Long>, PagingAndSortingRepository<Product, Long>> {
dan1st
dan1st2y ago
Stack Overflow
Spring data Pageable and LIMIT/OFFSET
i'm looking at migrating our traditional jpa/dao solution to Spring Data. However, one of our front-ends is SmartGWT, and their databound components load data progressively using limit/offset only,
dan1st
dan1st2y ago
public class OffsetLimitPageRequest extends PageRequest {
private int offset;
public OffsetLimitPageable(int offset, int limit, Sort sort){
super(offset,limit, sort);
this.offset=offset;
}
@Override
public long getOffset(){
return this.offset;
}
}
public class OffsetLimitPageRequest extends PageRequest {
private int offset;
public OffsetLimitPageable(int offset, int limit, Sort sort){
super(offset,limit, sort);
this.offset=offset;
}
@Override
public long getOffset(){
return this.offset;
}
}
yourRepository.findAll(new OffsetLimitPageRequest(start, limit, Sort.by(Sort.Direction.DESC, "colName")))
JavaBot
JavaBot2y ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?