taglib

Access raw expression of ValueExpression attribute to taglib component

倖福魔咒の 提交于 2019-12-05 21:49:31
Can I access the expression string of a ValueExpression passed as attribute value to my taglib component? My goal is to programmatically derive missing attribute values from it. In this case I'm trying to avoid having to repeat an attribute as a literal. now: <a:columnText title="name" value="#{entity.name}" sortBy="entity.name" /> desired: <a:columnText title="name" value="#{entity.name}" /> -taglib.xml <tag> <tag-name>columnText</tag-name> <source>column-text.xhtml</source> <attribute> <name>value</name> <required>true</required> </attribute> <attribute> <name>title</name> <required>false<

JSPX namespaces not visible for EL functions?

岁酱吖の 提交于 2019-12-05 18:57:21
I'm attempting to use JSPX (pure XML syntax for JSP) and running into what seems like it should work, but doesn't. I'm importing taglibs using namespace declarations in the jsp:root element, then using these later on for elements as well as EL functions: <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/ xmlns:c="urn:jsptld:/WEB-INF/tld/c.tld" xmlns:fn="urn:jsptld:/WEB-INF/tld/fn.tld"> ... <c:if test="${fn:length(list) > 0"> ... </c:if> ... </jsp:root> I get an exception saying "The attribute prefix fn does not correspond to any imported tag library". Other pages work fine, but this

Why use <g:textField /> in Grails?

五迷三道 提交于 2019-12-05 16:30:09
问题 What is the reason to use g:textField in Grails if you're already familiar with standard HTML form tags? If I understand correctly the following two markup alternatives are equivalent: <input type="text" name="name" value="${params.name}" id="name" /> <g:textField name="name" value="${params.name}" /> Are there any circumstances under which using g:textField would add value? Am I missing something? 回答1: The textField tag is provided as a convenience (slightly shorter than writing the HTML

Guice - Inject dependency into a class with static helper methods

穿精又带淫゛_ 提交于 2019-12-05 02:56:58
I'm still new to Guice and haven't used any DI frameworks before. After reading the official wiki and many other documents I'm still unable to wrap my head around it completely. In my particular case I want to write a EL taglib function that uses some other (to-be-injected) class. As all taglib functions have to be declared as static, I can't just @Inject my dependency via constructor or setter. I thought of using the requestStaticInjection() method described in http://code.google.com/p/google-guice/wiki/Injections#Static_Injections but I unable to get it to work and haven't been able to find

Passing a enum value as a tag attribute in JSP

99封情书 提交于 2019-12-05 01:32:27
I have a custom JSP tag which is using a parameter which is an enum. This approach is a consequence of using other classes which need this enumeration. The point is I have no clue how to assign an enum value in the EL: <mytaglib:mytag enumParam="${now what do I type here?}" /> The only workaround which I found so far was to make the enumParam an Integer and convert it to desired values: <mytaglib:mytag enumParam="3" /> I believe there must be a better way to do it. Please help. devpg EL allows the use of Enums! There are three ways to set a tag attribute value using either an rvalue or lvalue

Taglib: Performance and crashes problems

那年仲夏 提交于 2019-12-05 00:54:25
问题 I'm using the taglib library (1.7.2) in my Qt application, to read some metadatas of mp3 files from a music folder. The problem is that I find it very slow. For example, this is the code: QString path = "C:/Music/"; QDir d(path); QStringList fileTypes; fileTypes << "*.mp3" ; d.setNameFilters(fileTypes); QStringList pathList = d.entryList( QDir::NoDotAndDotDot | QDir::Files); QTime t; t.start(); foreach (QString fileName, pathList) { fileName = path + fileName; TagLib::FileRef *f = new TagLib:

Linking error with taglib on Windows

心不动则不痛 提交于 2019-12-05 00:07:53
问题 I built taglib static libraries for Windows as follows. Gotto use mingw, not VS. Check out git clone https://github.com/taglib/taglib.git git_taglib Installed cmake with Win32 installer from cmake.org Configure cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=/C/taglib_package -DCMAKE_C_COMPILER=/C/MinGW4.4/bin/gcc.exe -DCMAKE_CXX_COMPILER=/C/MinGW4.4/bin/g++.exe -DENABLE_STATIC=ON -DENABLE_STATIC_RUNTIME=ON -DHAVE_ZLIB=0 Compile mingw32-make.exe Install mingw32-make.exe install to C:\taglib

Loading Album art with TagLib sharp and then saving it to same/different file in C# causes memory error

走远了吗. 提交于 2019-12-04 12:28:36
问题 My application lists all MP3's in a directory and when the user selects a file it loads the tag info, including album art. The art is loaded into a variable to be used when the user saves the data. The art is also loaded into a picture frame for the user to see. // Global to all methods System.Drawing.Image currentImage = null; // In method onclick of the listbox showing all mp3's TagLib.File f = new TagLib.Mpeg.AudioFile(file); if (f.Tag.Pictures.Length > 0) { TagLib.IPicture pic = f.Tag

Data binding without using spring taglib

走远了吗. 提交于 2019-12-04 12:15:34
My html is built without using the spring taglib and now I'd like to bind the parameters of the form to a object in my controller. Currently my form looks like this <form> <input type="text" name="frAccUserMgmt.userName"/> <input type="password" name="frAccUserMgmt.userPwd"/> </form> The relevant part of my object is Class FrAccUserMgmt { private String userName; private Strint userPwd; // getter and setter } My controller is @RequestMapping("login") Public ModelAndView doLogin(FrAccUserMgmt frAccUserMgmt) { //code } How do I go about binding it. Currently the binding doesn't happen. I just

Spring security - SecurityContext.authentication null in taglib and jsp but ok in controller

独自空忆成欢 提交于 2019-12-04 07:22:52
I've been struggling with this issue for a little while now. Found several posts about it but none solved my problem. It will probably have something to do with the fact that a SecurityContext is boud to a specific Thread but even then I do not know how to solve it: Consider following code to retrieve the user that was logged in: SecurityContextHolder.getContext().getAuthentication().getPrincipal() Running this code in a controller would return (correctly) the user logged in. Running this code from a taglib or jsp throws NPE (authentication = null). Also the spring tag does not function