[MAGNOLIA-514] Form example Created: 03/Aug/05  Updated: 10/Aug/05  Resolved: 10/Aug/05

Status: Closed
Project: Magnolia
Component/s: samples
Affects Version/s: 2.1 Final
Fix Version/s: 2.1 Final

Type: Bug Priority: Major
Reporter: Nicolas Modrzyk Assignee: Fabrizio Giustina
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Any


Attachments: File mail-patch.tar.gz    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

I am using 2.1RC3 and I am highly suspicious that the example form does not work. (It does not work either on the online demo from the Magnolia site)

  • the action attribute should be :
    ${pageContext.request.contextPath}${actpage.handle}.html
    while at the moment it is:
    ${actpage.handle}.html
    which leads to an unknow page ... (or
  • there is also a ClassCastException, the following code:
    ===========
    Iterator it=Resource.getActivePage(request).getContentNode("mainColumnParagraphs").getChildren().iterator();
    while (it.hasNext()) {
    ContentNode node=(ContentNode) it.next();
    ===========
    is casting objects retrieved form the iterator to (ContentNode) while the expected is actually 'info.magnolia.cms.core.Content' ...

Also, I would be for moving the class MailHandler to a proper class in the Magnolia code, and have it log the exception when mailing failed along with successfully logging sent emails ...



 Comments   
Comment by Nicolas Modrzyk [ 03/Aug/05 ]

following the above:

MailHandler mail=new MailHandler(server,toObj.length,ccLength);

throws
java.lang.UnsupportedOperationException: Method not yet implemented

which was hidden because of the
catch (Exception e) {} block ...

Comment by Nicolas Modrzyk [ 03/Aug/05 ]

Sorry the above is wrong:

The exception is not coming from the MailHandler call but:

java.lang.UnsupportedOperationException: Method not yet implemented
at javax.mail.internet.MimeMessage.<init>(MimeMessage.java:89)
at org.apache.jsp.templates.jsp.samples.templateForm.main_jsp$MailHandler.sendMail(main_jsp.java:50)

Comment by Nicolas Modrzyk [ 03/Aug/05 ]

Patch for the main.jsp related to the form. (redirect, classcast as explained in previous comments)
As well as, I've put the CacheHandler to a separate class for logging exception.

And of course, the NotImplementedException needs the mail.jar and activation.jar libraries that cannot be redistributed within the LGPL license, silly me.

Comment by Fabrizio Giustina [ 03/Aug/05 ]

committed to svn, thanks

Generated at Mon Feb 12 03:18:11 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.