简体   繁体   中英

Redirect html page from rest web service

I am new to all html and rest web service.

I have use html form in index.jsp file which accepts the username and the password. This form call rest web service using action attribute.

Web service authenticate the user from the username and the password provided. Now depending upon the authentication done by web service, I have to send various pages to client's browser again. Like for manager, employee, admin, there will different pages for each one of these. Depending on the authentication, designation is fetched from the database in web service.

I have tried with doing Response.TemporaryRedirect(uri); and Response.seeOther(uri); But it didn't work for me.

Is there any other way to redirect page from rest web service? Thank you.

如果您使用的是JSP,并且后面有REST,则仍然可以使用Servlet过滤器,因为您正在谈论Web应用程序。

Solved, I need to write the code for redirection using Response.TemporaryRedirect(uri) in the finnaly block. It works for me.

正如我前面提到的那样,正如您所说的那样,HTML和REST服务位于同一位置,最好查看Servlet过滤器...它们主要在访问应用程序REST URL时调用

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM