Mrjndong / socialauth

Automatically exported from code.google.com/p/socialauth
0 stars 0 forks source link

Cannot resolve reference to bean accessDenied.jsp #210

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What version of the product are you using? On what operating system?
SocialAuth 2.3
Linux

Hi,

My project has a different structure from the one in this tutorial. The jsp 
files are inside another folder than JSP.

It's like this:

WEB-INF (folder)

- web.xml - properties.xml - root-context.xml
com.locationapp.Application (folder)

- ssl (folder)
- accessDenied.jsp - (other jsp files)
With this configuration: <bean id="socialAuthWebController" 
class="org.brickred.socialauth.spring.controller.SocialAuthWebController">

<constructor-arg value="http://server_url/context_name" /> <constructor-arg 
value="authSuccess.do" /> <constructor-arg 
ref="/com.locationapp.Application/ssl/accessDenied.jsp" />
</bean>
I get the error "Cannot resolve reference to bean 
'/com.locationapp.Application/ssl/accessDenied.jsp' while setting constructor 
argument"

Please help,

Thanks

Original issue reported on code.google.com by ping...@gmail.com on 8 Aug 2012 at 1:13

GoogleCodeExporter commented 8 years ago
The tutorial which I was referring is "Using SocialAuth with Spring MVC" 

Original comment by ping...@gmail.com on 8 Aug 2012 at 1:24

GoogleCodeExporter commented 8 years ago
Hi 

To resolve this, you have to do following.

Make following entry in root-context.xml file

<bean id="viewResolver" 
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
        <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
        <property name="prefix" value="/WEB-INF/com.locationapp.Application/ssl/"/>
        <property name="suffix" value=".jsp"/>
</bean>

Create One controller because SocialAuth library use redirects, so you have to 
create one controller for mapping.

@Controller
public class AccessDeniedController {
    @RequestMapping(value = "/accessDeniedAction")
    public ModelAndView getRedirectURL(final HttpServletRequest request)
            throws Exception {
        ModelAndView mv = new ModelAndView();
        mv.setViewName("accessDenied");

        return mv;
    }
}

Make following entry in root-context.xml file

<bean id="socialAuthWebController" 
class="org.brickred.socialauth.spring.controller.SocialAuthWebController">
        <constructor-arg value="http://opensource.brickred.com/socialauthdemo" />
        <constructor-arg value="authSuccess.do" />
        <constructor-arg value="accessDeniedAction.do" />
</bean>

Please note : - for every view you will have to use the same location. Means 
all your  jsp pages should be in ssl folder and in Controller you'll have to 
pass just jsp page name without extension.

I hope, it will help.

Regards
Tarun

Original comment by tar...@brickred.com on 24 Aug 2012 at 3:29

GoogleCodeExporter commented 8 years ago
Closing this issue.

Please let me know, if you are still facing the issue.

Regards
Tarun

Original comment by tarun.na...@3pillarglobal.com on 15 Oct 2012 at 11:33