Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8059965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:50:13+00:00 2026-06-05T09:50:13+00:00

I have a java class LayoutManager.java, which I pass as a Sprean Bean into

  • 0

I have a java class

LayoutManager.java, which I pass as a Sprean Bean into my jsp page using

 <custom:useSpringBean var="layoutManager" bean="LayoutManager"/>

How do I call methods from LayoutManager.java inside my jsp using the spring bean?

I feel like I would use some form of servlets <% %>, but not sure about the syntax

I want to call the method

 public Iterable<Layouts> getSpecificLayout(String subjectName)

The only spring code I have right now is

 public class UseSpringBean extends SimpleTagSupport
 {
     public void doTag() throws JspException, IOExceptionP
        PageContext pageContext = (PageContext)getJspContext();
        WebApplicationContext springContext = WebApplicationContextUtils.getWebApplicationContext(pageContext.getServletContext());
        pageContext.setAttribute(var, springContext.getBean(bean), PageContxt.PAGE_SCOPE);
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:50:14+00:00Added an answer on June 5, 2026 at 9:50 am

    If you really want the list of Layouts to be used in the jsp page then from the spring controller you need to add this list in the ModelMap so that its visible in the jsp page.

    Something like:

    @RequestMapping(value="/getSpecificLayout", method = RequestMethod.GET)
    public String getSpecificLayout(Stirng subjectName, ModelMap model){
        Iterable<Layouts> layouts = getSpecificLayout(String subjectName);
        model.addAttribute("layouts", layouts);
        return "listLayouts";
    }
    

    in jsp:

    <c:for items="listLayouts" var="layout">
      <c:out value="layout.name"/>
    </c:for>
    

    (This is not a tested code just a sample. Sorry somehow the code editing is not working, I mean I am not able to see the inline editor).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a java class which fires custom java events. The structure of the
I have a JAVA class in which I have implemented parsing of XML using
I have a Java class which handles both single valued and multi-valued data. Therefore,
If I have a java class which is package-private (declared with class, not public
I have a Java class which has some field annotated with @SearchCriteria(criteria = class1.class2.field)
I have a java class that creates a process, called child, using ProcessBuilder. The
I have a Java class in which every method was defined as static .
I have a Java class which uses Apache POI to generate reports in Excel.
I have Java bean class and I want to sort list of these beans
I have a java class which attempts to autologin to a website. The status

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.