Question

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>
Was it helpful?

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.

OTHER TIPS

If you are looking for auto-page refresh then try this:

<meta http-equiv="refresh" content="10"/>

Put this in the html/jsp page head tag, it wil refresh the page for every 10 seconds, you may change it as per your requirement.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top