Search code examples
javatiles-3

Need to referesh pages to retrieve their information


I have different types of users, when a user is logged in I need to show a specific page that is associated to that user's type.

The problem is that since the application directly retrieve the pages from Tile it does not retrieve their information, therefore I need to refresh the page to let it retrieve its information and get populated.

How should I make it to do it automatically?

Java

 public static String getRole() {
    String user = SecurityContextHolder.getContext().getAuthentication().getAuthorities().toString();

    if user is standard{
       return "stand";
    }

    if user is vip{
       return "vip";
    }
 }

Struts.xml

 <action name="myProject" class="com.myProject.controller.authentication">
            <result name="stand" type="tiles">standard</result>
            <result name="vip" type="tiles">vip</result>
            <result name="">index.jsp</result>
 </action>

Solution

  • You are making requests to Tiles not to the specific actions, no wonder that it shows blank pages.

    You need to redirect it to the particular action, to retrieve the information and show the required pages.