taglib

Passing a enum value as a tag attribute in JSP

99封情书 提交于 2019-12-12 09:34:58
问题 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. 回答1: EL allows

Integrate Spring Beans and JSP Tags

霸气de小男生 提交于 2019-12-12 04:30:15
问题 Is it possible to integrate Spring beans and JSP tags somehow in Spring. That is use a Spring bean as a JSP Tag? And if so is this a good/terrible idea? So something like this would be possible: @Component public class SomeBean extends SimpleTagSupport { @Autowired SomeBean someBean; @Override public void doTag() throws JspException, IOException { getJspContext().getOut().write(someBean.doSomething()); } } What would I do in the tags.tld to get it to use the Spring bean instead of creating a

Testing a custom Grails TagLib method that uses request object

与世无争的帅哥 提交于 2019-12-12 03:09:30
问题 Total 'testing newbie' wanting to test the addJsFile method of my custom TagLib. What am I missing? TagLib: import com.company.group.application.helper.Util ... class MyTagLib { static namespace = 'mytag' def util ... def addJsFile = { if (util.isSecureRequest(request)) { out << '<script src="https://domain.com/jsfile.js"></script>' } else { out << '<script src="http://domain.com/jsfile.js"></script>' } } } Test (as far as I could get): import org.springframework.http.HttpRequest import com

Can't add image keywords if there were no keywords to begin with, Taglib-Sharp

强颜欢笑 提交于 2019-12-12 02:45:28
问题 I'm trying to add metadata keywords to image files using Taglib-Sharp. My problem is that the following code: image.ImageTag.Keywords = (string[])newTags.ToArray(typeof(string)); image.Save(); does nothing if there are no keywords in the file to begin with. If I open the file properties in Explorer and add tags manually first, it works just fine and adds the tags to the file. I've tried setting a breakpoint at the top of this method and I can see that image.ImageTag.Keywords has a length of

Open file in TagLib with Unicode chars in filename

寵の児 提交于 2019-12-12 01:17:58
问题 I am quite new to the C++ 'area' so I hope this will not be just another silly 'C++ strings' question. Here is my problem. I want to integrate TagLib (1.5, 1.6 as soon as I manage to build it for Windows) into an existing Windows MFC VS2005 project. I need it to read audio files metadata (not write). The problem is that the program stores the input file names using CString(), and it has the Unicode option turned on (so the default chars are "wchar_t"). The reason for this (I think, the

Insert values into an Access Database that contain brackets/braces

泪湿孤枕 提交于 2019-12-11 15:35:47
问题 Using taglib-sharp and OleDb, I'm attempting to index a folder of music files and store all the metadata from said files in an Access Database (I'll probably switch to SQL Compact or something later but the book I have uses Access). The below code should retrieve and store the metadata of the first 1000 files in a given folder and subfolders OleDbCommand cmd = con.CreateCommand(); DirSearch(@"C:\Users\Stephen\Music"); TagLib.File tagFil; for (int i = 0; i < 1000; i++) { tagFil = TagLib.File

<table:column> Roo-tag for property of referenced entity

社会主义新天地 提交于 2019-12-11 12:03:20
问题 I've got a two classes (pupil, class) in a Roo-project and their scaffolded views. pupil and class have a 1:1 relationship In the list.jspx of pupil I'd like to display a column for a property of class. I don't know the correct attributes to give to the table:column-tag. This following example gives the error: SpelEvaluationException: EL1027Epos 4): Indexing into type 'com.pupil' is not supported <table:table data="${pupil}" duplicate="true" id="l_com_pupil" path="/admin/pupil" z="user

BitmapImage SetSource Crashing/Freezing App

我的未来我决定 提交于 2019-12-11 09:32:59
问题 I am trying to set the image from a stream. However when I set the source from the background thread and use a dispatcher it freezes the app completely. The stream is not null, I have verified that. I am using the taglib api to get the stream of the album picture of an mp3 file. I've tried everything. async void Background(object sender, MediaPlayerDataReceivedEventArgs e) { IRandomAccessStream AlbumArtStream = await Media.GetAlbumArt(MediaFile.Name, await MediaFile.OpenStreamForReadAsync());

How to encode a parameter with a url in struts?

泄露秘密 提交于 2019-12-11 06:29:09
问题 A list of books is displayed on the page. When a user clicks a book, its detail page is opened. Now the problem is that I need to encode each book's id with the detail page url. The link to detail page is /loadDetailForm.do. If a book has id=23, the link should appear as /loadDetailForm.do?id=23. I am pasting code here: <logic:notEmpty name="BrowseForm" property="books"> <logic:iterate id="book" property="books" name="BrowseForm" type="com.nms.bks.app1.domain.Book"> <p><html:link action="

Maven Dependency for Spring and Portlet tags

☆樱花仙子☆ 提交于 2019-12-11 06:04:33
问题 I have this following problem in Netbeans IDE - when I create a JSP file and put these two taglibs inside <%@taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0" %> <%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%> then I get error The absolute uri ... cannot be resolved . So I am wondering where could be the problem?Application is working correctly when is deployed to AS but I would like to enjoy things like autocompletion during development. My pom.xml looks