Comments Posting w/o scripting - Lost control over my JSP flow

Hi all,
Imagine you have a page where users can view comments from other users. And imagine that members can also post comments, but non-member guests can not. You want everyone to get the same page, but you want members to see more things on the page. You want a conditional <jsp:include> and of course you don't want to do it with scripting but do it with JSTL.
I already have the following:
1. web.xml
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
    <servlet>
        <servlet-name>JSTL Member Servlet</servlet-name>
        <servlet-class>com.example.MemberServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>JSTL Member Servlet</servlet-name>
        <url-pattern>/Tester.do</url-pattern>
    </servlet-mapping>
</web-app> 2. MemberServlet.java
package com.example;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class MemberServlet extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {
        String userType = "member";
        request.setAttribute("userType", userType);
        RequestDispatcher view = request.getRequestDispatcher("result.jsp");
        view.forward(request, response);     
3. result.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
    <body>
        <strong>Member Comments</strong>
        <hr>${commentList}<hr>
        <c:if test="${userType eq 'member'}">
            <jsp:include page="inputComments.jsp"/>
        </c:if>
    </body>
</html>
4. inputComments.jsp
<form method="post" action="commentsProcess.jsp">
    Add your comments: <br>
    <textarea name="input" rows="10" cols="40"/><br>
    <input name="commentSubmit" type="button" value="Add Comment"/>
</form>Now, how must the JSP file commentsProcess.jsp looks like with JSTL?
Any suggestions?
Regards,
bjoon

Hi all,
Imagine you have a page where users can view comments from other users. And imagine that members can also post comments, but non-member guests can not. You want everyone to get the same page, but you want members to see more things on the page. You want a conditional <jsp:include> and of course you don't want to do it with scripting but do it with JSTL.
I already have the following:
1. web.xml
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
    <servlet>
        <servlet-name>JSTL Member Servlet</servlet-name>
        <servlet-class>com.example.MemberServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>JSTL Member Servlet</servlet-name>
        <url-pattern>/Tester.do</url-pattern>
    </servlet-mapping>
</web-app> 2. MemberServlet.java
package com.example;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class MemberServlet extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {
        String userType = "member";
        request.setAttribute("userType", userType);
        RequestDispatcher view = request.getRequestDispatcher("result.jsp");
        view.forward(request, response);     
3. result.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
    <body>
        <strong>Member Comments</strong>
        <hr>${commentList}<hr>
        <c:if test="${userType eq 'member'}">
            <jsp:include page="inputComments.jsp"/>
        </c:if>
    </body>
</html>
4. inputComments.jsp
<form method="post" action="commentsProcess.jsp">
    Add your comments: <br>
    <textarea name="input" rows="10" cols="40"/><br>
    <input name="commentSubmit" type="button" value="Add Comment"/>
</form>Now, how must the JSP file commentsProcess.jsp looks like with JSTL?
Any suggestions?
Regards,
bjoon

Similar Messages

  • I lost control over my Airport Express

    I lost control over my Airport Express. It is still working, wireless network is alright, but the Airport Utility can not find it. I reinstalled the utility on my desktop but still the same.

    That's irritating. What is the exact message provided by AirPort Utility? Is it something like "No configured AirPort base stations have been found"?
    What version of AirPort Utility are you using, which AirPort Express model do you have (look on its case for a number like A1084, A1264 or A1392), and what version of OS X are you using?

  • In Windows XP I have lost control over third party cookies

    I bought a refurbished computer with Windows XP. But now I have noticed there is no control over cookies in Firefox. In Windows Vista there was 'block third party cookies' there was 'state which websites to permanently block' or 'allow' and even then I was only using Firefox... Now there is nothing. On top of that none of the "cookies control" add-ons for Firefox seem to be any good at all. I don't know what to do!
    Why would Firefox change with Windows XP?? I can see with IE of course but Windows operating system has nothing to do with Firefox, if you know what I mean.

    Please review this information [[Enabling and disabling cookies]]

  • After changing short user's name I lost control over my imac

    Do I have to enable the root user to fix all the problems? I can't even add the extra click button within mouse settings. Helpful advice desperately needed.
    Thxs in advance

    did you follow the instructions in this support article ?
    another read on the matter here.
    perhaps the reads will provide pointers.
    good luck !
    JGG

  • Lost control over my leoServer

    Hi
    after password issues with my macbook i experienced the same problems with my MacMini OS X Server (Leopard, recently updated). I wondered if it is technicly possible that someone had hacked my system - or both of my systems? I am only using the server occasinally as a file server. I have to say, that before that happened we had a short in the house and the electricity went off for a few minutes. The server was not on during this and the Macbook was running through the battery. But the VDSL-router got turned off.
    The problem: I can't access my server anymore. I tried "t"-mode to access it via firewire from my macbook and I tried to reinstall from the DVD (holding "c"). Nothings works. The log in just doesn't work.
    Any ideas? Thanks for any help.

    Hi Mike
    thanks for your reply.
    As for hacking: it was strange that both of my macs have issues at the same time. I could not access them anymore. For the MacBook (Leo) I could not assign a new password using the DVD. I mean, I could assign it and I could write a new hint which got displayed after three tries, but I could not access my Macbook. I used a time time machine backup, but even that one had the same issues. Well, in that case I could reinstall the MacBook and was than dragging stuff back by hand. The thing happened, after I wanted to install iLife 09 when the system asked me for the password. Out of the blue...
    Strange, that at the same time I had password Issues as well with my MacMini (Leo server).
    Back to your question: I am talking about the main login. Starting up the Mini. Option to change volumes doesn't work - and holding c has no effekt either.
    Hope you understand my situation now better. The funny thing is, that I "see" my server from the macbook and was able to get files from there. But there is no way to access it.
    Thanks for any further help.
    I appreciate it.
    juergen

  • Lost control over sound after Lion installation.  2009 MacBook Pro.  Solutions?

    After I updated to Lion on my mid 2009 MacBook Pro, my sound is unable to be adjusted, no matter what I try.  Took it to Apple store and it started working fine, but once I got it back the sound icon is grayed out and no ability to adjust sound again.  Not a logic board issue.  The headphone jack does not turn red.  Any solutions or anyone else with this problem?

    This happened to me.  A reboot fixed it for me.

  • I've Lost Control over my Home Page(s)

    Greetings Team Firefox,
    I've just upgraded to Firefox 12.0, and I have a problem that I could use some help with. I can't change my home page(s). For some reason, Firefox insists on using my current home pages, which happen to be 6 different web pages. Firefox won't change to the default, a single web site, a blank page, or anything else.
    I'm running Windows 7 X64 on a laptop.
    If anybody has any suggestions, I would certainly appreciate them. Thanks much.
    Regards,
    Collie
    [email protected]

    Hello madperson,
    I had a look at the user.js file, and found it was clobbered. The first character in the first line was an illegal character, and notebook choked on it (notebook would not open the .js file). I deleted user.js, and Voila! I'm back in business. Thanks much for your immediate response and excellent advice.
    Regards,
    Collie

  • Appear to have lost all control over phone

    Hi
    i'm hoping somone here can help. i've lost complete control over my music volume and certain apps just keep opening at random. It started on the way into work, smart connect seemed to keep trying to open and i heard a womans voice talking over my music, it was the instructions on how to use smart connect.
    Since then i've had my music go loud, then all the way to silent and vice versa. it's extremely frustrating. i've disabled Smart Connect entirely and now when i start music playing, my screen won't lock at all. At one point i somehow even opened the Xperia version of siri by accident.
    No idea whats going on, any advice?
    i'm very close to just factory resetting the entire thing.  i'm running the latest version of Android and all my apps are up to date

    That's quite odd, I'd do a Phone repair via PC Companion or Mac Bridge better than factory resetting it.
    A proud Sony User since 2002
    If I was helpful to you, thank me by Kudos

  • Article - Top 5 signs you've lost control of your reusable VIs

    [cross-post]
    Hi All,
    I've written a follow-up article on
    software reuse that I think will hit close to home for many LabVIEW
    developers. I know that it certainly describes some of the experiences
    and frustrations I've felt, over the years, while trying to reuse VIs.
    As usual, I'm interested in your feedback
    Top 5 signs you’ve lost control of your reusable VIs
    Thanks,
    -Jim

    I didn't see any 1 star rating... 
    I wrote a comment on the site that I will share below:
    Wow.. I’ve lived all 5 scenarios… 
    Plus I have the VI Package Manager… I’ve got to find the time and start using it..
    The article is quite true..  Shared libraries are not a simple thing..  Thanks for sharing and looking forward to your next article.
    I'll have to do some more exploring of the Package Manager once my office renovation is completed (hopefully this fall).
    R

  • Lost controll of mouse, new folders opening

    lost controll of mouse, new folders being created without my imput, different apps opening up without my concent, only way to shut down computer is just to hold power button down as i have no control over mouse to do anything. cant use apple hardware test, wont boot into the hardware test, its as if someone else is controlling my 15` macbook pro, lion, 2011. is this a virus or hardware or software problem. help please!!!! peter

    There are several possible causes for this issue. Please take each of the following steps that you haven't already tried until it's resolved. Some may not apply in your case.
    1. Follow the instructions in this support article, and also this one, if applicable. A damaged or defective AC adapter could be the cause, even if it's the right kind.
    2. Press down all four corners of the trackpad at once and release. If there's any effect, it's likely to be temporary, and in that case the unit must be serviced or replaced.
    3. Open the Bluetooth preference pane in System Preferences and delete all pointing devices other than the trackpad, if applicable. Disconnect any USB pointing devices. By a "pointing device," I mean a peripheral that moves the cursor, such as a trackpad, mouse, trackball, or graphics tablet. A plain keyboard is not a pointing device.
    4. Start up in safe mode and test, preferably without launching any third-party applications. If you don't have the problem in safe mode, but it comes back when you restart as usual, stop here and post your results. Do the same if you can't start in safe mode. If there was no difference in safe mode, go on to the next step.
    5. Reset the System Management Controller.
    6. If you're using a Bluetooth trackpad or mouse, investigate potential sources of interference, including USB 3 devices.
    7. A swollen battery in a portable computer can impinge on the trackpad from below and cause erratic behavior. If you have trouble clicking the trackpad, this is likely the reason. The battery must be replaced without delay.
    8. There's a report that a (possibly defective) Thunderbolt Ethernet adapter can cause the built-in trackpad of a MacBook to behave erratically. If you're using such an adapter, disconnect it and test.
    9. There's also a report of erratic cursor movements caused by an external display that was connected but not turned on.
    10. If none of the above applies, or if you have another reason to think that your computer is being remotely controlled, remove it from the network by turning off Wi-Fi (or your Wi-Fi access point), disconnecting from a Bluetooth network link, and unplugging the Ethernet cable or USB modem, whichever is applicable. If the cursor movements stop at once, you should suspect an intrusion.
    11. Make a "Genius" appointment at an Apple Store to have the machine and/or external trackpad tested.

  • Acrobat 9: Control over font in text box

    Versions: OS X 10.8.5 with Acrobat Pro 9, latest patch.
    I am experimentally preparing a four day training course by adding my instructor information to a PDF of the slide show.  There are only 850 slides, so it makes sense to experiment with this small document.
    All is going well.  I have created some custom stamps.  Acrobat has only crashed twice, losing not more than two hours work as a result.  I am optimistic I will be good to go in 10 more days.
    I have just copied some test into a text box and it copied as black and blue text with a larger font than the standard red font that I have been seeing until now.
    It occurs to me that this implies there may be some control over the text.  I realize that Acrobat is not meant to be a document preparation tool, so I hunted around somewhat for a way to change the text box text to not-red, gave up and I have been putting up with it until now.
    However, there are implications (but no clearly stated solutions) that there is a way to change the font, size and colour of text in text boxes.
    Do you know how?  I cannot work it out, nor can I find a solutoin.  I can see that the Commenting preference pane offers Small Medium and Large text.  There does not seem to be any other control other than the style (italic, bold, superscript, subscript) that is offered in the context menu.
    Hints?  Thoughts? 

    Pryanja.
    Thanks again.  If offers a dropdown for Colour, a box for style (plain, bold italic etc) and a button marked more, but they seem to do nothing at all.  They don't change what I type, and they don't affect selected text.  Looks to me tha they just take up some toolbar space.
    Is it possible that it does not work on Mac?

  • Add Control over Copyright Watermark Font

    Now with the V1.3 we got the nice export size option based on longer/shorter image size, and I could stop to use additional resizing step upon export.
    With one exception: The Watermark added by Lightroom is too huge for my taste. And I used to generate (say) twice bigger image, and resize it than to a smaller dimension. By doing so, the watermark got also scaled down in size.

    I had my copyright watermark working nicely in my web exports after tweaking my fonts using
    Jeffreys Lightroom Configuration Manager. However in the upgrade to 1.2 or 1.3 I lost my settings, and haven't been able to get it the right size since. So I'm left adding it outside of LR (dumb hassle) or leaving it off altogether (less than ideal). I hope it's possible to make an export plugin that will give control over some sort of watermark for export, but hopefully in time the watermark ability will grow from the print and slideshow modules into the web and export ones...

  • C7280 - Cannot scan. Error message says another program has control over the device

    I opened the HP Device Manager to do a scan. I accepted the settings and the scan started. But part way through the scan, I stopped the scan as I realized that I wanted to change the resolution. I quit the Device Manager  and restarted it but when I did, I got an error message saying:
    "The function you have requested cannot be performed because another program has control over the device".
    I don't have anything else open and so I can't work out what program has control over the printer.
    C7280 Prtinter. Mac OSX 10.7.
    This question was solved.
    View Solution.

    I was thinking that if you stopped the process in mid-scan that there may be some background processes still running. Rebooting usually stops those processes.
    No, you will not have to do this each time.  Next time, though, it may be easier to just let the scan complete and the do another scan at whatever setting you want.
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • Having issues with my MacBook. Even when the internet is disconnected, apps are still closing and opening on their own. I sometimes do not have control over my cursor.....any suggestions?

    Having issues with my MacBook. Even when the internet is disconnected, apps are still closing and opening on their own. I sometimes do not have control over my cursor.....any suggestions?

    There are several possible causes for this issue. Please take each of the following steps that you haven't already tried until it's resolved. Some may not be apply in your case.
    1. Follow the instructions in this support article, and also this one, if applicable. A damaged or defective AC adapter could be the cause, even if it's the right kind.
    2. Open the Bluetooth preference pane in System Preferences and delete all pointing devices other than the trackpad, if applicable. Disconnect any USB pointing devices. By a "pointing device," I mean a peripheral that moves the cursor, such as a trackpad, mouse, trackball, or graphics tablet. A plain keyboard is not a pointing device.
    3. Start up in safe mode and test, preferably without launching any third-party applications. If you don't have the problem in safe mode, but it comes back when you restart as usual, stop here and post your results. Do the same if you can't start in safe mode. If there was no difference in safe mode, go on to the next step.
    4. Reset the System Management Controller.
    5. If you're using a Bluetooth trackpad, investigate potential sources of interference, including USB 3 devices.
    6. A swollen battery in a portable computer can impinge on the trackpad from below and cause erratic behavior. If you have trouble clicking the trackpad, this is likely the reason. The battery must be replaced without delay.
    7. Press down all four corners of the trackpad at once and release. If there's any effect, it's likely to be temporary, and the unit needs to be serviced or replaced.
    8. There's a report that a (possibly defective) Thunderbolt Ethernet adapter can cause the built-in trackpad of a MacBook to  behave erratically. If you're using such an adapter, disconnect it and test.
    9. There's also a report of erratic cursor movements caused by an external display that was connected but not turned on.
    10. If none of the above applies, or if you have another reason to think that your computer is being remotely controlled, remove it from the network by turning off Wi-Fi (or your Wi-Fi access point), disconnecting from a Bluetooth network link, and unplugging the Ethernet cable or USB modem, whichever is applicable. If the cursor movements stop at once, you should suspect an intrusion.
    11. Make a "Genius" appointment at an Apple Store to have the machine and/or external trackpad tested.

  • External control over vst's; or some kind of midi learn

    I'm moving this post from Audition Feature Requests to here, 'couse nobody ansewer anything..
    External control over vst's; a midi learn-like
    I'm not really shure if AA3 have it or not, but I can't find the way to get control of parameters on third part plugins with my BCR2000.. (rotary control)
    I can use my midi keyboard to play Vsti
    I can use my Mackie for the main mixer...
    But what about the capability of automatise, for example.. a feedback level's delay whit some rotary external midi hardware?
    Maybe it is possible and I don't know, but I can't find the way to do it searching in AA3... I neither can't find info on internet forums..
    I'll be very grateful if anyone say something about it
    Thanks!!
    Nico

    Hi Nico,
    Currently, Audition offers no direct support for controlling VST parameters via MIDI, although there are VST effects that handle MIDI control themselves.  It is a feature I'd like to see, and it is currently in our feature database in consideration for the next release of Audition.
    Durin

Maybe you are looking for

  • Premiere Elements 8 Project Won't Open. Please Help.

    Hello, I was working on a Premiere Elements 8 project for my video class last night (HDV, 1080i 30p) and the program stopped responding as I was importing a clip. I was prompted to wait for response or close the program. I closed the program and when

  • Parallel Approval

    Dear Experts, This issue is occurred with one of our customer . They are using  SAP B1 2007B SP:00 PL 13 As per their request we enabled approval for A/R Invoice and Outgoing payment. Both the documents having one level of approval where 2 approvers

  • How  business transation data,opening balances are uploaded through lsmw?

    hi,      please tel me hoe to upload the open balances,business transation data of the vendor,customer and gl account through lsmw? along with that please explain the uploading theough bdc.........    i am eagerly waiting for ur answer...............

  • How do a find the version of a library?

    I've got a situation where a fix was to patch Solaris. The patch updated /usr/lib/libCrun.so.1 among other things. Now I need to tell others that they will need to have an updated version of this file. I don't see where pkginfo gives the version deta

  • PO confirmation greater than PO quantity

    Hi! how is it possible to create 2 inbound deliveries in the confirmation tab that has greater quantity than the PO quantity?  I saw a PO like this, but everytime Im trying to replicate it, the system does not allow me to create it.  Im just wonderin