Forums de discussion

Stuck in hook

shubhranshu swain, modifié il y a 12 années.

Stuck in hook

New Member Publications: 18 Date d'inscription: 19/01/11 Publications récentes
Hi All,

I am currently working in liferay hook. I am able to invoke the liferay provided jsps in my code. But there are some things still missing. The jsp is not able to identify the implicit objects like user, themeDisplay, company, authType etc.

Dont know how to deal with the issue. Any help would be much appreciated.

Regards
thumbnail
Ravi Kumar Gupta, modifié il y a 12 années.

RE: Stuck in hook

Liferay Legend Publications: 1302 Date d'inscription: 24/06/09 Publications récentes
Generally that error wont come, make sure that you are not removing any include statement in the JSP you are using. Try comparing your modified JSP with the one in deployment for the original content.

Thanks and Regards
Ravi
shubhranshu swain, modifié il y a 12 années.

RE: Stuck in hook

New Member Publications: 18 Date d'inscription: 19/01/11 Publications récentes
Thanks Ravi and Nisarg
thumbnail
Pranay R Patadiya, modifié il y a 12 années.

RE: Stuck in hook

Regular Member Publications: 177 Date d'inscription: 23/02/10 Publications récentes
Hi,
Is your problem resolved?

Thanks,
Pranay Patadiya
shubhranshu swain, modifié il y a 12 années.

RE: Stuck in hook

New Member Publications: 18 Date d'inscription: 19/01/11 Publications récentes
Hi,

Yes. The issue has been resolved now. But the jsp is not able to identify the "authType" object. Dont know how to deal with this. Please help.

Regards
thumbnail
Ravi Kumar Gupta, modifié il y a 12 années.

RE: Stuck in hook

Liferay Legend Publications: 1302 Date d'inscription: 24/06/09 Publications récentes
shubhranshu swain:

Yes. The issue has been resolved now. But the jsp is not able to identify the "authType" object. Dont know how to deal with this. Please help.


Can u please paste some code where u r using this..
shubhranshu swain, modifié il y a 12 années.

RE: Stuck in hook

New Member Publications: 18 Date d'inscription: 19/01/11 Publications récentes
I have imported login.jsp

the code is as below

<%@ include file="/custom_jsps/html/common/init.jsp" %>
<%
String redirect = ParamUtil.getString(request, "redirect");

String login = LoginUtil.getLogin(request, "login", company);
String password = StringPool.BLANK;
boolean rememberMe = ParamUtil.getBoolean(request, "rememberMe");

if (Validator.isNull(authType)) {
authType = company.getAuthType();
}
%>

<%
String loginLabel = null;

if (authType.equals(CompanyConstants.AUTH_TYPE_EA)) {
loginLabel = "email-address";
}
else if (authType.equals(CompanyConstants.AUTH_TYPE_SN)) {
loginLabel = "screen-name";
}
else if (authType.equals(CompanyConstants.AUTH_TYPE_ID)) {
loginLabel = "id";
}
%>


in the above code the jsp is not able to identify the "authType" object.

Regards
Shubhranshu
thumbnail
Lalit Jugran, modifié il y a 12 années.

RE: Stuck in hook

Junior Member Publications: 33 Date d'inscription: 25/07/10 Publications récentes
Hi shubhranshu swain,

I don't think any such object(authType) available on jsp page in liferay. You have to create it explicitly. For objects available in jsp page kindly check the link. http://www.mpowerglobal.com/web/ravi/home/-/blogs/default-objects-in-jsp-page-of-liferay
shubhranshu swain, modifié il y a 12 années.

RE: Stuck in hook

New Member Publications: 18 Date d'inscription: 19/01/11 Publications récentes
Thanks for the response,

I am facing a new problem now i.e.,

<%@ include file="/custom_jsps/html/common/init.jsp" %>

in this include statement the error is

Multiple annotations found at this line:
- UserLockoutException cannot be resolved to a type
- PasswordExpiredException cannot be resolved to a
type
- CookieNotSupportedException cannot be resolved to
a type
- AuthException cannot be resolved to a type
- windowState cannot be resolved
- UserPasswordException cannot be resolved to a type
- UserScreenNameException cannot be resolved to a
type
- UserEmailAddressException cannot be resolved to a
type

The jar files which contain these classes is portal-service.jar. I have also tried adding this jar file in lib folder but all in vain.

Please help me get out of this.

Regards
Shubhranshu
Nisarg Parikh, modifié il y a 12 années.

RE: Stuck in hook

Expert Publications: 262 Date d'inscription: 31/12/09 Publications récentes
Hey,

Just write <liferay-theme:defineObjects /> in your init.jsp or at the top of your current jsp. Make sure you have added tag library for liferay-theme.
This will automatically add the implicit objects in your page.

Hope this will help you.

-Nisarg