我正在尝试使用新的ExtJs 5.我根据ExtJs5定义的MVC模式创建了一个小应用程序.
我正在使用ViewControllers每一个View.
问题陈述:现在假设我有两个VC(Controller1和Controller2).每个人都有自己的方法.我希望从Controller1调用Controller2的方法.我想从Controller1更新与Controller2关联的视图.
E.g. Suppose there is a separate view for Status Bar and a ViewController(StatusBarController).
This VC has a method to update the view based on whatever message it receives as input parameter.
All the other controllers in the application will call this VCs method to update the status of the application on the status bar.
Run Code Online (Sandbox Code Playgroud)
在以前的版本中,this.getController('StatusBarController')用于获取任何控制器的句柄,然后调用其方法.
但是当我使用ViewController时,这在我的情况下不起作用.
任何人都可以指导我如何实现这个目标吗?而且这是否是正确/理想的方式来做这样的事情还是有更好的选择?
这是我的代码:
StatusBarView:
Ext.define('MyApp.view.statusbar.StatusBarView', {
extend : 'Ext.panel.Panel',
controller: 'StatusBarController',
region : 'south',
xtype …Run Code Online (Sandbox Code Playgroud) 我想让password我的User表的列case sensitive在mysql中.
以下是该表的描述:
/*Table: mst_user*/
FIELD TYPE COLLATION
------------- ------------ -----------------
user_id VARCHAR(100) latin1_swedish_ci
first_name VARCHAR(25) latin1_swedish_ci
last_name VARCHAR(25) latin1_swedish_ci
USER_PASSWORD VARCHAR(50) latin1_swedish_ci
user_status INT(11) (NULL)
version_id INT(11) (NULL)
active_status INT(11) (NULL)
user_type INT(11) (NULL)
Run Code Online (Sandbox Code Playgroud)
为了使USER_PASSWORD字段区分大小写,我执行以下查询:
ALTER TABLE `mst_user` MODIFY `USER_PASSWORD` VARCHAR(50) COLLATE `latin1_general_cs`;
Run Code Online (Sandbox Code Playgroud)
这种方法很有效,现在该字段区分大小写.
但我有一个存储过程,它SELECT在此表上执行查询以检查用户是否存在给定的凭据.
存储过程::
CREATE PROCEDURE `usp_password_verify`(ip_login_id VARCHAR(200),
ip_user_password VARCHAR(200),
INOUT success INT(1),
INOUT tbl_usr_password VARCHAR(100),
INOUT pkg_user_password VARCHAR(100))
BEGIN
SELECT COUNT(*)
INTO success
FROM mst_user
WHERE UPPER (user_id) …Run Code Online (Sandbox Code Playgroud) 我试图使用Interceptor处理我的struts2应用程序中的会话超时请求.以下是与此相关的文件:
web.xml中:
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<session-config>
<session-timeout>1</session-timeout>
</session-config>
Run Code Online (Sandbox Code Playgroud)
struts.xml中:
<package name="default" extends="struts-default">
<interceptors>
<interceptor name="sessionInterceptor"
class="com.platform.web.security.SessionInterceptor" />
</interceptors>
<action name="doLogin"
class="com.platform.web.action.LoginAction">
<result name="input">/login/login.jsp</result>
<result name="error">/login/login.jsp</result>
<result type="chain">menuAction</result>
</action>
<action name="menuAction"
class="com.platform.web.action.MenuAction">
<interceptor-ref name="sessionInterceptor"/> //Interceptor included here
<result name="SUCCESS">/jsp/main.jsp</result>
<result name="ERROR">/login/login.jsp</result>
<result name="input">/jsp/myFavourite.jsp</result>
</action>
Run Code Online (Sandbox Code Playgroud)
拦截器类:
public class SessionInterceptor extends AbstractInterceptor implements StrutsStatics {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public String intercept(ActionInvocation invocation) throws Exception {
final ActionContext context = invocation.getInvocationContext();
HttpServletRequest request = (HttpServletRequest) …Run Code Online (Sandbox Code Playgroud) 我必须在浏览器屏幕上以印地语(或任何区域语言)显示文本.我将从数据库中获取此文本.
为此,我从一个非常基本的层面开始,具体如下:
String escapedStr = "\\u0905\\u092d\\u0940 \\u0938\\u092e\\u092f \\u0939\\u0948 \\u091c\\u0928\\u0924\\u093e";
String hindiText = StringEscapeUtils.unescapeJava(escapedStr);
System.out.println(hindiText);
return hindiText;
Run Code Online (Sandbox Code Playgroud)
我能够在变量中完美地获得印地语文本hindiText.但是当我在eclipse控制台或浏览器屏幕上打印时,我只能得到它???? ?? ??
我将浏览器的默认字符编码以及我的eclipse控制台设置为UNICODE(UTF-8).但仍然没有成功.
谁能帮我解决这个问题?我错过了什么设置?
只是fyi - 我能够在浏览器中打开印地文网站.所以语言设置不是问题.
编辑
由于我正在为我的视图使用JSP文件,因此我在web.xml全局中添加了以下内容以设置字符编码.参考:跟着这个
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<page-encoding>UTF-8</page-encoding>
</jsp-property-group>
</jsp-config>
Run Code Online (Sandbox Code Playgroud)
但仍然没有成功!
在我的 ExtJs 代码中,我正在检查警告标志的值。
如果设置了标志,我想向用户显示一个确认(OKCANCEL)框,即使有警告,我也会询问用户是否要继续。
现在就像任何确认框一样,如果用户单击确定,代码应该按顺序继续下一个命令,如果他单击取消,代码应该返回。
以下是我的代码:
if(warning){
Ext.MessageBox.show({
title: 'Icon Support',
msg: 'Are you sure you want to proceed?',
buttons: Ext.MessageBox.OKCANCEL,
icon: Ext.MessageBox.WARNING,
fn: function(btn){
if(btn == 'ok'){
// go to the alert statement below.
} else {
return;
}
}
);
alert('wants to proceed ahead'); //if user clicks OK then come here
}
Run Code Online (Sandbox Code Playgroud)
现在我面临的问题是,当代码进入if块时,它会显示消息框,然后发出警报wants to proceed ahead。
我可以通过return;在alert().
但是,在用户单击“确定”按钮后如何转到警报语句?
extjs ×2
javascript ×2
callback ×1
extjs5 ×1
httprequest ×1
interceptor ×1
java ×1
mysql ×1
session ×1
sql ×1
struts2 ×1
unicode ×1