|
|
|
Как привязаться к тому ViewObject, что юзается на странице?
|
|||
|---|---|---|---|
|
#18+
Oracle JDeveloper, ADF BC+Struts+JSP. рабочий код: public class AuthentificationAction extends DataForwardAction { // To handle an event named "yourname" add a method: // public void onYourname(DataActionContext ctx) // To override a method of the lifecycle, go to // the main menu "Tools/Override Methods...". static ApplicationModule m_appMod; static ViewObject m_vo; protected void findForward(DataActionContext actionContext) throws Exception { // TODO: Override this oracle.adf.controller.struts.actions.DataAction method super.findForward(actionContext); DCBindingContainer bindings = actionContext.getBindingContainer(); DCControlBinding binding = bindings.findCtrlBinding("Login"); String login = (binding != null) ? binding.toString() : ""; binding = bindings.findCtrlBinding("Password"); String password = (binding != null) ? binding.toString() : ""; if (m_appMod == null) { String qualifiedAMDefName = "AuthentificationPackage.AuthentificationAppModule"; String configName = "AuthentificationAppModuleLocal"; m_appMod = (ApplicationModule)Configuration. createRootApplicationModule(qualifiedAMDefName, configName); } if (!login.equals("")) { if (m_vo == null) m_vo = m_appMod.createViewObject("Auth0010UsersViewObject1", "AuthentificationPackage.Auth0010UsersViewObject"); String keyValues[] = { login }; Key key = new Key( keyValues ); Row row = m_vo.getRow(key); String password2 = (String)row.getAttribute("Password"); System.out.println("password2: " + password2); if (!password.equals(password2)) { System.out.println("password: " + password); ActionMessages messages = new ActionMessages(); messages.add("feedback", new ActionMessage("message.login.error")); saveMessages(actionContext.getHttpServletRequest(), messages ); } else actionContext.getHttpServletRequest().getSession(). setAttribute("isLogged", ""); } } } Приведённый рабочий вариант сильно плох в том плане, что я создаю ViewObject, а не привязываюсь к тому, что юзается на странице. Как привязаться к тому, что юзается на странице? В данном случае это не критично, но на для другой страницы мне нужно настроить её ViewObject, потому как он должен отображать только строки, удовлетворяющие условию, которое динамически формирует пользователь. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.06.2007, 16:46:27 |
|
||
|
|

start [/forum/topic.php?fid=59&msg=34575688&tid=2145515]: |
0ms |
get settings: |
15ms |
get forum list: |
19ms |
check forum access: |
6ms |
check topic access: |
6ms |
track hit: |
35ms |
get topic data: |
14ms |
get forum data: |
4ms |
get page messages: |
58ms |
get tp. blocked users: |
2ms |
| others: | 287ms |
| total: | 446ms |

| 0 / 0 |
