How to show PASSED tests in Jenkins test results - jenkins

Once Jenkins job is done it will display all and failed tests but there are no passed tests. I need this for my mail notification. It would be more convenient for me to have here a list of all passed tests:
enter image description here

Allow me to answer to myself: You just need to update a bit existing html emial notification: https://github.com/jenkinsci/email-ext-plugin/blob/master/src/main/resources/hudson/plugins/emailext/templates/html.jelly
Read this also to know where to put new file:
https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=59506969
Copy this part of file
<!-- JUnit TEMPLATE -->
<j:set var="junitResultList" value="${it.JUnitTestResult}" />
<j:if test="${junitResultList.isEmpty()!=true}">
<TABLE width="100%">
<TR><TD class="bg1" colspan="2"><B>JUnit Tests</B></TD></TR>
<j:forEach var="junitResult" items="${it.JUnitTestResult}">
<j:forEach var="packageResult" items="${junitResult.getChildren()}">
<TR><TD class="bg2" colspan="2"> Name: ${packageResult.getName()} Failed: ${packageResult.getFailCount()} test(s), Passed: ${packageResult.getPassCount()} test(s), Skipped: ${packageResult.getSkipCount()} test(s), Total: ${packageResult.getPassCount()+packageResult.getFailCount()+packageResult.getSkipCount()} test(s)</TD></TR>
<j:forEach var="failed_test" items="${packageResult.getFailedTests()}">
<TR bgcolor="white"><TD class="test_failed" colspan="2"><B><li>Failed: ${failed_test.getFullName()} </li></B></TD></TR>
</j:forEach>
</j:forEach>
</j:forEach>
</TABLE>
<BR/>
</j:if>
paste it again and change it slightly:
<!-- JUnit TEMPLATE -->
<j:set var="junitResultList" value="${it.JUnitTestResult}" />
<j:if test="${junitResultList.isEmpty()!=true}">
<TABLE width="100%">
<TR><TD class="bg1" colspan="2"><B>JUnit Tests</B></TD></TR>
<j:forEach var="junitResult" items="${it.JUnitTestResult}">
<j:forEach var="packageResult" items="${junitResult.getChildren()}">
<TR><TD class="bg2" colspan="2"> Name: ${packageResult.getName()} Failed: ${packageResult.getFailCount()} test(s), Passed: ${packageResult.getPassCount()} test(s), Skipped: ${packageResult.getSkipCount()} test(s), Total: ${packageResult.getPassCount()+packageResult.getFailCount()+packageResult.getSkipCount()} test(s)</TD></TR>
<j:forEach var="passed_test" items="${packageResult.getPassedTests()}">
<TR bgcolor="white"><TD class="test_passed" colspan="2"><B><li>Passed: ${passed_test.getFullName()} </li></B></TD></TR>
</j:forEach>
</j:forEach>
</j:forEach>
</TABLE>
<BR/>
</j:if>

Related

IMPORTHTML/IMPORTXML suddenly returning 'resource at URL not found' [duplicate]

This question already has answers here:
Scraping data to Google Sheets from a website that uses JavaScript
(2 answers)
Closed last month.
My importhtml and importxml functions in Google Sheets suddenly stopped working. I'm guessing it has something to do with the URL as it has been working for about a month (since I set it up) and has only recently stopped (last week). Now half the sheets is displaying #N/A unfortunately. Just wondering if someone more advanced in this area could share their insight into the problem.
IMPORTXML example:
URL: https://au.finance.yahoo.com/quote/AZJ.AX/profile?p=AZJ.AX
xPath: //*[#id='Col1-0-Profile-Proxy']/section/div[1]/div/div/p[2]/span[4]
Function returning "Resource at URL not found".
Here is a link to an example file:
https://docs.google.com/spreadsheets/d/1ml3cCHIEk4vTCn3GyymXGxyCpVBgMprMzGP7OYhKPC0/edit?usp=sharing
EDIT:
This looks like it may in fact be a issue on Google's side:
https://issuetracker.google.com/175144626
There has not been any resolution, but go and star that issue if it affects you or you want updates.
Maybe Yahoo has changed its site structure
I have not used the Yahoo site a lot, but maybe it has changed its format in a way that makes it unreadable for IMPORTXML. I also tested it with IMPORTHTML, with the same result. The function itself is still working with other sites though.
Testing the site you gave, disabling JavaScript to ensure the data is not dynamically generated (which makes it unreadable for IMPORTHTML), there is in fact a table:
<table class="W(100%)" data-reactid="36">
<thead data-reactid="37">
<tr class="C($tertiaryColor) Fz(xs) BdB Bdc($seperatorColor)" data-reactid="38">
<th class="Ta(start) Py(6px) Fw(n)" data-reactid="39"><span data-reactid="40">Name</span></th>
<th class="Ta(start) Py(6px) Fw(n)" data-reactid="41"><span data-reactid="42">Title</span></th>
<th class="Ta(end) Py(6px) Fw(n)" data-reactid="43"><span data-reactid="44">Pay</span></th>
<th class="Ta(end) Py(6px) Fw(n)" data-reactid="45"><span data-reactid="46">Exercised</span></th>
<th class="Ta(end) Py(6px) Fw(n)" data-reactid="47"><span data-reactid="48">Year born</span></th>
</tr>
</thead>
<tbody data-reactid="49">
<tr class="C($primaryColor) BdB Bdc($seperatorColor) H(36px)" data-reactid="50">
<td class="Ta(start)" data-reactid="51">
<span class="" data-reactid="52">
<!-- react-text: 53 -->Mr. Andrew T. Harding<!-- /react-text -->
</span>
</td>
<td class="Ta(start) W(45%)" data-reactid="54">
<span class="" data-reactid="55">
<!-- react-text: 56 -->MD, CEO & Director<!-- /react-text -->
</span>
</td>
<td class="Ta(end)" data-reactid="57">
<span class="" data-reactid="58">
<!-- react-text: 59 -->2.78M<!-- /react-text -->
</span>
</td>
<td class="Ta(end)" data-reactid="60"><span class="" data-reactid="61"><span data-reactid="62">N/A</span></span></td>
<td class="Ta(end)" data-reactid="63">
<span class="" data-reactid="64">
<!-- react-text: 65 -->1967<!-- /react-text -->
</span>
</td>
</tr>
<tr class="C($primaryColor) BdB Bdc($seperatorColor) H(36px)" data-reactid="66">
<td class="Ta(start)" data-reactid="67">
<span class="" data-reactid="68">
<!-- react-text: 69 -->Mr. George Lippiatt<!-- /react-text -->
</span>
</td>
<td class="Ta(start) W(45%)" data-reactid="70">
<span class="" data-reactid="71">
<!-- react-text: 72 -->CFO & Group Exec. Strategy<!-- /react-text -->
</span>
</td>
<td class="Ta(end)" data-reactid="73">
<span class="" data-reactid="74">
<!-- react-text: 75 -->481.25k<!-- /react-text -->
</span>
</td>
<td class="Ta(end)" data-reactid="76"><span class="" data-reactid="77"><span data-reactid="78">N/A</span></span></td>
<td class="Ta(end)" data-reactid="79"><span class="" data-reactid="80"><span data-reactid="81">N/A</span></span></td>
</tr>
<tr class="C($primaryColor) BdB Bdc($seperatorColor) H(36px)" data-reactid="82">
<td class="Ta(start)" data-reactid="83">
<span class="" data-reactid="84">
<!-- react-text: 85 -->Mr. Ed McKeiver<!-- /react-text -->
</span>
</td>
<td class="Ta(start) W(45%)" data-reactid="86">
<span class="" data-reactid="87">
<!-- react-text: 88 -->Group Exec. of Coal<!-- /react-text -->
</span>
</td>
<td class="Ta(end)" data-reactid="89">
<span class="" data-reactid="90">
<!-- react-text: 91 -->861k<!-- /react-text -->
</span>
</td>
<td class="Ta(end)" data-reactid="92"><span class="" data-reactid="93"><span data-reactid="94">N/A</span></span></td>
<td class="Ta(end)" data-reactid="95"><span class="" data-reactid="96"><span data-reactid="97">N/A</span></span></td>
</tr>
<tr class="C($primaryColor) BdB Bdc($seperatorColor) H(36px)" data-reactid="98">
<td class="Ta(start)" data-reactid="99">
<span class="" data-reactid="100">
<!-- react-text: 101 -->Mr. Michael G. Carter BEng, BBus, MAICD, AFAIM<!-- /react-text -->
</span>
</td>
<td class="Ta(start) W(45%)" data-reactid="102">
<span class="" data-reactid="103">
<!-- react-text: 104 -->Group Exec. of Technical Services & Planning<!-- /react-text -->
</span>
</td>
<td class="Ta(end)" data-reactid="105"><span class="" data-reactid="106"><span data-reactid="107">N/A</span></span></td>
<td class="Ta(end)" data-reactid="108"><span class="" data-reactid="109"><span data-reactid="110">N/A</span></span></td>
<td class="Ta(end)" data-reactid="111"><span class="" data-reactid="112"><span data-reactid="113">N/A</span></span></td>
</tr>
<tr class="C($primaryColor) BdB Bdc($seperatorColor) H(36px)" data-reactid="114">
<td class="Ta(start)" data-reactid="115">
<span class="" data-reactid="116">
<!-- react-text: 117 -->Mr. Christopher L. Vagg<!-- /react-text -->
</span>
</td>
<td class="Ta(start) W(45%)" data-reactid="118">
<span class="" data-reactid="119">
<!-- react-text: 120 -->Head of Investor Relations & Group Treasurer<!-- /react-text -->
</span>
</td>
<td class="Ta(end)" data-reactid="121"><span class="" data-reactid="122"><span data-reactid="123">N/A</span></span></td>
<td class="Ta(end)" data-reactid="124"><span class="" data-reactid="125"><span data-reactid="126">N/A</span></span></td>
<td class="Ta(end)" data-reactid="127"><span class="" data-reactid="128"><span data-reactid="129">N/A</span></span></td>
</tr>
<tr class="C($primaryColor) BdB Bdc($seperatorColor) H(36px)" data-reactid="130">
<td class="Ta(start)" data-reactid="131">
<span class="" data-reactid="132">
<!-- react-text: 133 -->Mark Hairsine<!-- /react-text -->
</span>
</td>
<td class="Ta(start) W(45%)" data-reactid="134">
<span class="" data-reactid="135">
<!-- react-text: 136 -->Mang. of Media & Communications<!-- /react-text -->
</span>
</td>
<td class="Ta(end)" data-reactid="137"><span class="" data-reactid="138"><span data-reactid="139">N/A</span></span></td>
<td class="Ta(end)" data-reactid="140"><span class="" data-reactid="141"><span data-reactid="142">N/A</span></span></td>
<td class="Ta(end)" data-reactid="143"><span class="" data-reactid="144"><span data-reactid="145">N/A</span></span></td>
</tr>
<tr class="C($primaryColor) BdB Bdc($seperatorColor) H(36px)" data-reactid="146">
<td class="Ta(start)" data-reactid="147">
<span class="" data-reactid="148">
<!-- react-text: 149 -->Ms. Tina Thomas<!-- /react-text -->
</span>
</td>
<td class="Ta(start) W(45%)" data-reactid="150">
<span class="" data-reactid="151">
<!-- react-text: 152 -->Group Exec. of Corp.<!-- /react-text -->
</span>
</td>
<td class="Ta(end)" data-reactid="153"><span class="" data-reactid="154"><span data-reactid="155">N/A</span></span></td>
<td class="Ta(end)" data-reactid="156"><span class="" data-reactid="157"><span data-reactid="158">N/A</span></span></td>
<td class="Ta(end)" data-reactid="159"><span class="" data-reactid="160"><span data-reactid="161">N/A</span></span></td>
</tr>
<tr class="C($primaryColor) BdB Bdc($seperatorColor) H(36px)" data-reactid="162">
<td class="Ta(start)" data-reactid="163">
<span class="" data-reactid="164">
<!-- react-text: 165 -->James Coe<!-- /react-text -->
</span>
</td>
<td class="Ta(start) W(45%)" data-reactid="166">
<span class="" data-reactid="167">
<!-- react-text: 168 -->Mang. of Market Intelligence & Sustainability<!-- /react-text -->
</span>
</td>
<td class="Ta(end)" data-reactid="169"><span class="" data-reactid="170"><span data-reactid="171">N/A</span></span></td>
<td class="Ta(end)" data-reactid="172"><span class="" data-reactid="173"><span data-reactid="174">N/A</span></span></td>
<td class="Ta(end)" data-reactid="175"><span class="" data-reactid="176"><span data-reactid="177">N/A</span></span></td>
</tr>
<tr class="C($primaryColor) BdB Bdc($seperatorColor) H(36px)" data-reactid="178">
<td class="Ta(start)" data-reactid="179">
<span class="" data-reactid="180">
<!-- react-text: 181 -->Mr. Dominic Dupont Smith<!-- /react-text -->
</span>
</td>
<td class="Ta(start) W(45%)" data-reactid="182">
<span class="" data-reactid="183">
<!-- react-text: 184 -->Company Sec.<!-- /react-text -->
</span>
</td>
<td class="Ta(end)" data-reactid="185"><span class="" data-reactid="186"><span data-reactid="187">N/A</span></span></td>
<td class="Ta(end)" data-reactid="188"><span class="" data-reactid="189"><span data-reactid="190">N/A</span></span></td>
<td class="Ta(end)" data-reactid="191">
<span class="" data-reactid="192">
<!-- react-text: 193 -->1964<!-- /react-text -->
</span>
</td>
</tr>
<tr class="C($primaryColor) BdB Bdc($seperatorColor) H(36px)" data-reactid="194">
<td class="Ta(start)" data-reactid="195">
<span class="" data-reactid="196">
<!-- react-text: 197 -->Lowana Riddiford<!-- /react-text -->
</span>
</td>
<td class="Ta(start) W(45%)" data-reactid="198">
<span class="" data-reactid="199">
<!-- react-text: 200 -->Warehouse Logistics Coordinator<!-- /react-text -->
</span>
</td>
<td class="Ta(end)" data-reactid="201"><span class="" data-reactid="202"><span data-reactid="203">N/A</span></span></td>
<td class="Ta(end)" data-reactid="204"><span class="" data-reactid="205"><span data-reactid="206">N/A</span></span></td>
<td class="Ta(end)" data-reactid="207"><span class="" data-reactid="208"><span data-reactid="209">N/A</span></span></td>
</tr>
</tbody>
</table>
The fact that there is a <span> element within each <td> should not affect IMPORTXML / IMPORTHTML as in other sites it can pick up the text content within <a> tags no problem.
However the comments for react <!-- react-text: 193 -->1964<!-- /react-text --> might be causing the Spreadsheet functions to get confused.
Their robots.txt file doesn't seem to contain any clues either:
User-agent: *
Sitemap: https://au.finance.yahoo.com/sitemaps/finance-sitemap_index_AU_en-AU.xml.gz
Disallow: /r/
Disallow: /__rapidworker-1.2.js
Disallow: /__blank
Disallow: /_td_api
Disallow: /_remote
Google's user agent is Mozilla/5.0 (compatible; GoogleDocs; apps-spreadsheets; http://docs.google.com)
So I can't say for sure what about the site makes it go wrong, but it is likely a change on the Yahoo side of things. Maybe they have rate limited Google's IP addresses
Use UrlFetchApp or better yet, an actual API
I believe you are pushing the limits of what is possible with humble Spreadsheet functions. Which is great, don't get me wrong, however, scraping with a tool that is really not meant for heavy scraping is not very reliable. Considering that web scraping is also not 100% reliable as a source of information as it is constantly subject to the scraped sites changing their HTML structure or leaving things to be dynamically generated by JavaScript. Things will eventually break.
With UrlFetchApp within Apps Script you have a lot more control and flexibility over how to scrape your data.
Though if this is a serious activity for you which requires dependability, it will pay off to use an API. APISs are designed for websites and sheets and databases to fetch data from them. They welcome it. There are some free offerings about too.
Your linked Google Sheet is nice work. These examples confirm the problem, and the timing. During the last week, numerous linking errors in previously working sheets have been reported. The linked Google Sheet summarizes some debugging examples to try to determine the problem.
The debugging example Ticker debug1 'C003.F' does not link. The linking error is '#N/A' 'Error Resource at URL not found'. In most sheets the majority of the links are now faulty.
IMPORTXML example:
URL: https://de.finance.yahoo.com/quote/
XPath: "//*[#id='quote-header-info']/div[3]/div[1]/div/span[1]"
Ticker C2: 'C003.F'
Formula: =TRANSPOSE(IMPORTXML(CONCATENATE("https://de.finance.yahoo.com/quote/", C2),"//*[#id='quote-header-info']/div[3]/div[1]/div/span[1]"))
The formula uses the OR '|' notation to decrease and limit the number of calls in a sheet.
Here is a link to debugging examples: https://docs.google.com/spreadsheets/d/1-xXw94LC3QL3rf-IoAAT9stwz06GTNMSV_v1a8YdWFw/edit?usp=sharing
debug1 Ticker C2: 'C003.F' does not link
debug3 Ticker: 'EXSB.DE' does link
debug6 Ticker: 'ALV.DE' does link
The debugging examples in the linked sheet demonstrate some formulas that work and others that do not. All web pages were checked and functioned.
Been having the same problem for several weeks with importxml showing #N/A when it was working before - bumping for interest.

When do you use th:remove="tag" versus th:block?

The following two blocks would evaluate the same, so when would you use th:remove="tag" over th:block?
<th:block th:text="${myBean.value}">[value]</th:block>
versus
<span th:remove="tag" th:text="${myBean.value}">[value]</span>
Since they can be used interchangeably I think it is opinion based... but for readability, my opinion is:
<th:block /> should be used for doing structural logic (th:if, th:each, etc..) and only when it's not possible on the parent tag. For example, in the case you have to contain more than one element in a loop -- e.g, a loop that produces 2 table rows for each object:
<table>
<th:block th:each="object: ${objects}">
<tr>
<td th:text="${object.data1}" />
<td th:text="${object.data2}" />
</tr>
<tr>
<td th:text="${object.data3}" />
<td th:text="${object.data4}" />
</tr>
</th:block>
<table>
th:remove should only be used for example data that should only be rendered when viewing the file in a browser/prototyping w/o rendering the thymeleaf:
<table>
<th:block th:each="object: ${objects}">
<tr>
<td th:text="${object.data1}" />
<td th:text="${object.data2}" />
</tr>
<tr>
<td th:text="${object.data3}" />
<td th:text="${object.data4}" />
</tr>
</th:block>
<tr th:remove="all">
<td>Mild Cinnamon</td>
<td>1.99</td>
</tr>
<tr th:remove="all">
<td>Other</td>
<td>Data</td>
</tr>
<table>
In the specific case where you want to output data/text without a tag, I prefer inline expressions. They're enabled by default in thymeleaf 3. So:
[[${myBean.value}]] instead of <th:block th:text="${myBean.value}">[value]</th:block>

accessing different servers (urls) using selenium ide

I've a requirement to hit a url of server x, click a submit button and jump to same url of server y and click the same submit button and this has to be repeated 26 times as I've to change on 26 servers.
All this I have to do selenium ide. I managed to do this for 1 server but just wondering if there is a smart way to do this for 26 servers rather recording 26 times.
I'm using selenium 2.9.0 IDE plugin with firefox browser
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://server-x:9173/" />
<title>New Test</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">New Test</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>website/delivery/DeliveryMethodsRepository/</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=DeliveryMethodsRepository/</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=invalidateCaches</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=submit</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=DeliveryMethodsRepository/</td>
<td></td>
</tr>
</tbody></table>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">New Test</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>inventory/InventoryRepository/</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=InventoryRepository/</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=invalidateCaches</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=submit</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=InventoryRepository/</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
You can keep base url as "http://". You then need to use readCSV for all server urls and while loop for repeating for number of servers.
Please refer [http://bashamy.blogspot.co.uk/2016/01/selenium-ide-to-use-while-loop-and-read.html] for more information.
Edit Url: http://bashamy.blogspot.com/2016/01/selenium-ide-to-use-while-loop-and-read.html
Eg: Below html code opens 5 different urls from my CSV input file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://onlineconversion.com/" />
<title>06 ReadCsv_n_Loop</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">06 ReadCsv_n_Loop</td></tr>
</thead><tbody>
<tr>
<td>readCSV</td>
<td>file://C:\Users\extayx\Documents\Selenium IDE\07Input.csv</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>1</td>
<td>row</td>
</tr>
<tr>
<td>store</td>
<td>1</td>
<td>col</td>
</tr>
<tr>
<td>store</td>
<td>6</td>
<td>z</td>
</tr>
<tr>
<td>while</td>
<td>${row}<${z}</td>
<td></td>
</tr>
<tr>
<td>storeCellValue</td>
<td>ip</td>
<td>${row},${col}</td>
</tr>
<tr>
<td>echo</td>
<td>${ip}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${ip}</td>
<td>${ip}</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars['row'] = ${row}+1</td>
<td>x</td>
</tr>
<tr>
<td>endWhile</td>
<td></td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
My input CSV file has below information.
www.google.co.in
www.google.com
www.google.co.uk
www.news.google.co.in
www.seleniumhq.org
Your question is very confusing, so I probably misunderstood it.
In the unlikely case I got it right, you're trying to do the same task for different websites 26 times. Sounds like something a loop could do.
Here's a sample Python code:
urls = ['http://foo.bar', 'http://otherfoo.otherbar',...]
for url in urls:
driver.get(url)
#your selenium code here
This is something I have had to do myself, and is possible using a set of plugins called selite or also selblocks (although selite contains a version of this plugin already)
With these plugins it will allow you to save the list of URLs as an external json file, then to loop the test case you will just need to put the 'Forjson' command calling the file at the stage where you want your loop to begin, and the 'Endforjson' where you want it to end. All the documentation is in the link. Hope it helps.

How to use a 'checkbox' to update shipping address to same as billing

So using Orchard CMS 1.6, When the customer creates an account they are prompt for invoice address and shipping address.
I would like a check box, below the invoice address, which will update the shipping address with the same invoice address details, as opposed to having to enter the same address twice.
Not sure how to do it, any help would be much appreciated) an example of the check box would be
<div class="checkbox">#Html.CheckBoxFor(m => signup.SameAddress)</div>
<div class="label">#Html.LabelFor(m => signup.SameAddress, T(Use same address as billing"))</div>
So far my code looks like this(below). ATM they have to enter the same details twice.
<article class="addresses form">
<fieldset>
<div class="span5">
<h2>#T("Invoice Address")</h2>
<table class="table-bordered table-striped table">
<colgroup>
<col id="Col1" />
<col id="Col2" />
</colgroup>
<thead>
<tr>
<th scope="col">#T("Name")</th>
<td>#invoiceAddress.Name.Value</td>
</tr>
<tr>
<th scope="col">#T("AddressLine1")</th>
<td>#invoiceAddress.AddressLine1.Value<</td>
</tr>
</thead>
</table>
</div>
//insert checkbox here
<div class="span5">
<h2>#T("Billing Address")</h2>
<table class="table-bordered table-striped table">
<colgroup>
<col id="Col1" />
<col id="Col2" />
</colgroup>
<thead>
<tr>
<th scope="col">#T("Name")</th>
<td>#shippingAddress.Name.Value</td>
</tr>
<tr>
<th scope="col">#T("AddressLine1")</th>
<td>#shippingAddress.AddressLine1.Value<</td>
</tr>
</thead>
</table>
</div>
</fieldset>
</article>

Grails GSP doesn't generate intended HTML under Geronimo

When running my Grails 1.1-M2 app as a WAR under Geronimo 2.1.4 (jetty6, javaee5), the HTML generated from the GSPs do not include my dynamic content.
Specifically, this GSP snippet:
<tr class="prop">
<td valign="top" class="name">
<label for="type">
<g:message code="album.type.label" default="Type" />
</label>
</td>
<td valign="top" class="value ${hasErrors(bean:albumInstance,field:'type','errors')}">
<g:select from="${AlbumType?.values()}" value="${albumInstance?.type}" name="type" ></g:select>
</td>
</tr>
...produces this HTML when running under Geronimo:
<tr class="prop">
<td valign="top" class="name">
<label for="type">
Type
</label>
</td>
<td valign="top" class="value ">
<select name="type" id="type" ></select>
</td>
</tr>
...however when running as 'grails run-app' or 'grails run-war', this, correct HTML is produced:
<tr class="prop">
<td valign="top" class="name">
<label for="type">
Type
</label>
</td>
<td valign="top" class="value ">
<select name="type" id="type" >
<option value="EP" >EP</option>
<option value="LP" >LP</option>
<option value="SINGLE" >SINGLE</option>
</select>
</td>
</tr>
AlbumType.groovy is defined in src/groovy as:
public enum AlbumType {
EP,
LP,
SINGLE
}
I've turned on all logging within Grails and don't see any error or exceptions. This issue is confusing as I only see it while running my Grails WAR under Geronimo. Granted, I haven't tried any other app servers though it is curious that everything works fine with 'grails run-app' and 'grails run-war'.
Any ideas as to the problem?
I would highly recommend keeping code out of the the default package and putting it into a good package structure. I suspect this is your issue.

Resources