I've been lurking around this site for a while now , and I would like to think that I know a thing or two about Java. Unfortunately, I am new to dealing with TLD files and EL.
Basically, I'm trying to call a method on a jsp page. Originally I used a scriptlet, but I heard that was bad programming practice and I am now switching my code to JSTL. I still need to call that method, however.
#1: It belongs in a servlet, rather than a JSP. Model1 vs Model2/MVC #2: Your method could possibly be improved by passing in an object rather than all of these related parameters.
ie addDoi(DoiObject doi)
where DoiObject has attributes of input, type etc etc as applicable.
Once you have that object, the majority of those <c:set> commands you have can probably be made redundant, as you can then populate the bean automagically from request parameters (either using a framework, or just a jsp:useBean and jsp:setProperty)
Bear Bibeault wrote:Freeze-drying names is not a good practice
This is the first time I've ever seen the term "freeze-drying" used to refer to the practice of crypticizing names... I like it Does this also apply to such classics as "pkgNbr", "bktCd", "pktSz", "trkWt", "trkLn" and other vowel-phobic names? (Translations: packageNumber, bracketCode, packetSize, truckWeight, trackLength).
if tou want to create the EL functions , firstly the function must be a static. in the TLD in which we define the <function-signature> we need to describe the full package name of type class. like you define the function in which you define String type parameter , but in TLD file if define the function signature , then describe the fully package name of class type , like java.lang.String for exmple :-
[code] <function-signature>void addDoi(java.lang.String doiInput, java.lang.String doiType, java.lang.String filename, java.lang.String source, java.lang.String productType, java.lang.String productLine, java.lang.String registrationMessage,
java.lang.String url, java.lang.String urlDescription, java.lang.String urlMetadata)</function-signature>[\code]
the basic type are automaticaly handel , there is no need to define full package name , like int , float etc