ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

simple servlet development on iseries

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Re: simple servlet development on iseries

    I just set:

    request.setAttribute("private_forums",private_foru ms);

    and then in freemarker i can do:

    <option value="${private_forums.getId()}">${private_forums .getName()}</option>

    Supposedly you could just use x.id but that's the way i used it.

    Check out http://freemarker.sourceforge.net/do...ctWrapper.html for more info.

    Comment


    • #32
      Re: simple servlet development on iseries

      But I'm not doing this stuff in freemarker. I'm doing it in websphere. Doing it with standard servlets and beans and then trying to get the expression language to access the data.

      i'm gonna go look into freemarker and see what its about though...
      Your future President
      Bryce

      ---------------------------------------------
      http://www.bravobryce.com

      Comment


      • #33
        Re: simple servlet development on iseries

        I did my project in freemarker, inside websphere. Freemarker is just a library you drop in WEB-INF/lib.

        I don't think your bean is being exposed to the servlet. Otherwise you wouldn't need freemarker, at least for that feature.

        Comment


        • #34
          Re: simple servlet development on iseries

          It should be exposed to it...they are part of the same package. They should have no problems seeing each other. I did see that my functions in the FormManager control class were protected so I changed them to public, but that still didn't help.

          I keep comparing my code to other examples and it looks good, i just can't seem to get it to pull the data from the bean....its so frustrating
          Your future President
          Bryce

          ---------------------------------------------
          http://www.bravobryce.com

          Comment


          • #35
            Re: simple servlet development on iseries

            How did this pan out in the end? I've been getting back into the old Java again recently and I was thinking about creating a web application.

            In an MVC world FreeMarker is just the View part. If you use an MVC framework like spring or struts (or something you create yourself) then you should be able to swap out a JSP view layer for a FreeMarker one quite easily.
            Ben

            Comment


            • #36
              Re: simple servlet development on iseries

              i'm not a java guru...nor do i wanna be...i cheat....generate the data into an XML file and bind it to a template html file...open the html file and voila....you're done.
              I'm not anti-social, I just don't like people -Tommy Holden

              Comment


              • #37
                Re: simple servlet development on iseries

                Sounds similar to the cocoon framework. That does a similar thing and makes it possible to have different channels. So in one case your XML might get translated into a web page and in another it might become a PDF.

                I like Java but it's not always easy to reap the full benefits. If you do it right then future maintenance can be child's play.
                Ben

                Comment


                • #38
                  Re: simple servlet development on iseries

                  here's an opensource project i worked on recently that generates XML and binds the data to an HTML page.
                  http://tommyholden.com/downloads/iledocs/iledocs.zip

                  the HTML:
                  ILEDOCS-QRPGLESRC-KR0058CMP-SQLRPGLE.html

                  the XML:
                  http://www.tommyholden.com/downloads...P-SQLRPGLE.xml
                  I'm not anti-social, I just don't like people -Tommy Holden

                  Comment


                  • #39
                    Re: simple servlet development on iseries

                    I did figure out my problem from above. I don't remember exactly anymore what the deal was. But I've gotten this project mostly converted to full MVC. I still have a couple things that are mash ups, but I'm in the process of rewriting them now.

                    Ben is right, its very hard sometimes to reap the full benefits of java. But if you can do it, its well worth it. I love the MVC model now that I know it. Maintenance is a breeze. I'm currently working on incorporating AJAX into my web app. If I can get this working with the features we want its gonna be AMAZING. My boss wants me doing some real professional web stuff. Stuff that a lot of web guys never touch. And I'm not even a web guy, well I wasn't, but I am becoming one quickly. I love being paid to learn new skills.

                    Happy New Year
                    Your future President
                    Bryce

                    ---------------------------------------------
                    http://www.bravobryce.com

                    Comment


                    • #40
                      Re: simple servlet development on iseries

                      Sounds like you've got a great job/employer. Also sounds like you're doing a good job there. If you're looking at incorporating AJAX into your Java web app then (if you haven't already) you might like to take a look at the following link. http://getahead.org/dwr
                      Ben

                      Comment

                      Working...
                      X