permission filtering is done, I used struts2 interceptors.
specific intercept procedures are as follows:
public String interceptASC (ActionInvocation invocation) throws Exception
{
System.out.print ("------------------------ enter intercept ------------ ------------- ");
ActionContext ctx = invocation.getInvocationContext ();
ActionContext context = ActionContext.getContext ();
Map session = ctx.getSession ();
String userid = (String) session.get ("userid");
userid = "67";
String resultStr = "";
boolean checkP = false;
if (userid == null | | userid.equals (""))
{
context.put ("messageStr", "Your login information has expired, please login again.");
System.out.println ("--------------- ---------------- User Login expired");
resultStr = "messagePage";
}
else
{
String getname = (String) ctx.getName ();
System.out.println ("------- Get actionName ----------- getname =" + getname);
if (getname.contains ("-----"))
{
System.out.println ("--------------- intercept ----------------");
/ / Here is the judge for permission
checkP = checkClass.checkPerm ("68", "column Access path") ;
if (checkP == true)
resultStr = invocation.invoke ();
else
{
System.out.println ("--------------- error, no rights! ----------------" );
context.put ("messageStr", "You do not have permission to perform this operation");
resultStr = "messagePage";
}
}
else
{
resultStr = invocation.invoke ();
}
}
return resultStr;
}
a result, every time you run into resultStr = invocation.invoke (); when there is an error problem when debugging, one to resultStr = invocation.invoke ();, it will jump to DefaultActionInvocation. class
Class File Editor
Source not found
the source attachement does not contain the source for the file DefaultActionInvocation.class.
You can change the source attachment by clicking Change Attached Source below:
but I see in my workspace below the project webroot / web-inf / lib / with xwork-core-2.1.6.jar
included in the release directory, there xwork-core-2.1.6.jar
I also try to open xwork-core-2.1.6.jar, there are references DefaultActionInvocation.class
This problem has troubled me for a long time, I hope you expert help to help, Thank you!
------ Solution ---------------------------------------- ----
you when debugging is certainly a step by step into the Source not found
because you do not what it is associated with the source files when debugging eclipse in your class files that are looking to give you information when prompted
What is the error message
------ Solution -------------------------------- ------------
DefaultActionInvocation is ActionInvocation to achieve it certainly will jump inside the class, because you are using this object invoke the.
As for the front page is blank: You do not say "wrong question" do? What is the problem
there may be configured to navigate to your front page configuration errors ... Organic front page to see if the source code ..
Also see if you can remove the interceptors running ... first ensure that the entire process can be implemented together with the interceptor
------ For reference only -------- -------------------------------
their top! Master ah master, help me with it
------ For reference only ------------------------------ ---------
from the top! Come on, help me have a look at it?
------ For reference only -------------------------------------- -
Upstairs you'd be great, that what the background is not being given the message that in my debugging, jump directly to the DefaultActionInvocation.class inside. Then I run in the end, nothing happens foreground with the background, stands to reason that it should be blocked jump to continue that page, but now is the blank front page.
/ / Compiled from DefaultActionInvocation.java (version 1.5: 49.0, super bit)
public class com.opensymphony.xwork2.DefaultActionInvocation implements com.opensymphony.xwork2.ActionInvocation {
/ / Field descriptor # 164 J
private static final long serialVersionUID =-585293628862447329L;
/ / Field descriptor # 169 Lcom/opensymphony/xwork2/util/logging/Logger;
private static final com.opensymphony.xwork2.util.logging.Logger LOG;
/ / Field descriptor # 171 [Ljava / lang / Class;
private static final java.lang.Class [] EMPTY_CLASS_ARRAY;
/ / Field descriptor # 173 Ljava / lang / Object;
protected java.lang.Object action;
/ / Field descriptor # 175 Lcom/opensymphony/xwork2/ActionProxy;
protected com.opensymphony.xwork2.ActionProxy proxy;
/ / Field descriptor # 177 Ljava / util / List;
/ / Signature: Ljava / util / List
protected java.util.List preResultListeners;
/ / Field descriptor # 181 Ljava / util / Map;
/ / Signature: Ljava / util / Map
protected java.util.Map extraContext;
/ / Field descriptor # 184 Lcom/opensymphony/xwork2/ActionContext;
protected com.opensymphony.xwork2.ActionContext invocationContext;
/ / Field descriptor # 186 Ljava / util / Iterator;
/ / Signature: Ljava / util / Iterator
protected java.util.Iterator interceptors;
------ For reference only -------------------- -------------------
addition, each time I have to bring their own through myeclipse tomcat restart the service, it will pop up a frame, I suggested that "multiple Errors have Occurred "
Also, I looked in the myeclipse project / properties / java build path / libraries inside
xwork-core-2.1.6.jar
------ For reference only ------------------------- --------------
Ha! Right right! Thank you, thank you, to solve!
------ For reference only -------------------------------------- -
passing, the same problem
------ For reference only ------------------------------ ---------
is to find problems
------ For reference only --------------------- ------------------
struts2 custom interceptor needs to inherit (public class MyInterceptor implements Interceptor )
------ For reference only ------------------ ---------------------
is to find problems
------ For reference only --------- ------------------------------
------ For reference only ---------------------------------- -----
I have encountered this problem
没有评论:
发表评论