let the page call this tag is not struts2, but the system of their own copy. Label with the same name as the package.
A direct click will enter the corresponding TLD file.
or how to find the TLD file from inside the jar package.
finding TLD files is useless, the key is to change the corresponding Java source code.
ctrl+shift+t Find the corresponding source code.
Find Source
Create a new package name and class name with the same source code
so the sub-classpath there will be exactly the same two classes, and finally the system calls which class is to see who was loaded first, because the class bytecode loaded only once , so who first loaded after the fixed unchanged. So first find who to use WHO. And classpath below is the priority loading code, can not find out to go to Lib to find the jar package to see if there is no class, that is, after creating a new class, the system will automatically use their own new this.
class source to find not doendtag this class, then in the parent class, my new class to rewrite Doendtag to implement their own functions.
@Overridepublic int Doendtag () throws Jspexception {//Gets the user who is currently logged on, username = (user) pagecontext.getsession (). getattribute ("User"), if (user = = null) {throw new RuntimeException ("No login user! ");} Gets the required permission URL (in the Action property value but needs to be processed) String Privurl = "/" + action;//determines whether to display the hyperlink if (User.hasprivilegebyurl (Privurl)) { return Super.doendtag (); Output <a> label, and continue executing the JSP code after this label} else {return bodytagsupport.eval_page;//No output <a> tags, continue executing the JSP code following this label}}
Modify the source code for the <s:a> tag