[MAGNOLIA-762] MgnlContext not initialized if a jsp is called directly (leads to javascript exception 'importClass not defined') Created: 03/Mar/06  Updated: 23/Jan/13  Resolved: 17/May/06

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: None
Fix Version/s: 3.0 RC1

Type: Bug Priority: Major
Reporter: Philipp Bärfuss Assignee: Philipp Bärfuss
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

If one opens the admin central one get's sometimes the javascript message:

not defined importClass() ..

caused by

java.lang.NullPointerException
at info.magnolia.cms.beans.runtime.MgnlContext.getLocale(MgnlContext.java:97)
at info.magnolia.cms.i18n.MessagesManager.getMessages(MessagesManager.java:270)
at org.apache.jsp.admintemplates.js.admincentral_jsp._jspService(admincentral_jsp.java:262)

This happens because the jsp does not initialize the context. Should we create a filter which sets the context if a jsp is called directly?

Currently it works only because tomcat reuses the thread



 Comments   
Comment by Philipp Bracher [ 13/Mar/06 ]

a virtual uri mappping will solve the issue

Comment by Philipp Bracher [ 17/May/06 ]

use: MgnlContext.initAsWebContext(request)

or call the jsp through the EntryServlet (doing this by registering a virtual URI mapping)

Generated at Mon Feb 12 03:20:25 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.