Question of using Struts for the J2EE pattern

I am now using Struts for the development. I have 3 questions about J2EE
pattern by the use of Struts:
1) How can I use Struts to create the Front Controller? In the book
descibing Front Controller, it is a servlet file which receives the request
and then dispatches to the appropriate view according to the request.
However, in using Struts, should I use the same way? However, I found that
in using Struts, I can call the controller class which subclass
ActionServlet, all the views forwarded are declared in the
struts-config.xml. Am I right in this method?
2) In the project, there is a Front Controller which dispatches the request
to the appropriate view (jsp file). Of course, I use Struts to do this.
However, I expect that the user is impossible for going to the view (jsp
page) directly by typing the address of the jsp file. I hope that the user
can go to the view through the controller only. How can I do this?
3) There is a problem by using browser - when a user browses a site, he can
press the 'back' button to the previous page, and then click the 'forward'
button also. How can I prevent this by using Struts? I found that in some
sites, when the user clicks the 'back' button, an error page displays. How
can I do this? Thanks!
Many Thanks!
Stephen

I'll take a stab at number 2 and number 3.......
2) You could have the controller object place a "flag" in the request that is dispatched to the JSP. Make the JSP check for that flag to ensure that this request came from the controller object. If the request comes from anywhere other than the controlle object, you can display an error page, or you could redirect them back to the controller. You could also use the HTTPSessionObject to place flags for users and have the JSP check there.
3) Keep a log of the user's activities in the HTTPSession. Whenever a page is invoked, have it check to see if the user has already been here, and if it is appropriate for the user to be here again.
Hope this helps!!
I'm not really a java programmer, I just play one on TV.

Similar Messages

  • Trying to call a Webservice - "Settings for the J2EE Server do not exist."

    Hi, we're on SAP ECC 6.0 and I'm trying to get access to a webservice:
    BAPI converted to Webservice ok
    Webservice activated ok
    http active ok
    WSADMIN - click on the WSDL button - browser launches, user id requested, userid given, WSDL displays perfect! Even tested from the outside.
    WSADMIN - click on the Web service homepage - Settings for WDSL generation (RPC or Document style, same result) - Error - "Settings for the J2EE Server do not exist."
    Internet browesr - I go to the URL for the WSDL - works again perfect!
    Internet browesr - I go to the URL  - error ! <faultstring xml:lang="en">SOAP processing failure, error id = 112 </faultstring>
    Are the two errors the same?
    Do I have to have a J2EE server to enable Webservices?
    Is this a complex system change?
    Is there a workaround?
    Thanks for any tips on getting Webservice to function
    Philip

    hi,
    when the WAS ABAP has a webserver running and the WSDL service up and running (WSDLs are created dynamically) you get the WSDL served from WAS ABAP.
    "Webservice homepage" is an application written in Java and running on WAS Java., So, if you want to use that application you have to have a WAS JAVA up and running, you have to have the application 'Webservice homepage' up and running and of course on WAS ABAP you have to have the URL of the WAS JAVA specified to enable the WSADMIN function to link you to the Java app.
    Most probably you do not even have a WAS Java running and/or the application 'webservice homepage" not set up. Either way, in my opinion the application "webservice homepage" is crap anyway (because it is not really independent. if SAP implements something strangely on the server side they of course implement it the same way on the client/testing side, so you never find out that in real world scenarios e.g. no client understands the feature X the way SAP implemented it). use any non-SAP-tool to test your SAP webservices, e.g. XML Spy, or SOAPUI.
    my 2 cents,
    anton

  • MAC QUESTION--I'm looking for the toggle button for thumbnails

    MAC QUESTION--I'm looking for the toggle button that use to be on the bottom right of desktop folders to increase and decrease the size of the thumbnails.  Does this still exist?

    Glad you got it going. I'm in Thumbnail mode most of the time in my Finder, so I didn't notice that the slider isn't there in others. I'm running Yosemite as well and I'm happy this feature has been kept.
    Thanks for letting me know
    Gene

  • HT4970 I have chosen not to use iCloud for the time being, and cannot get the Reminders i input on my Mac to replicate to my iphone and iPad?  any help is appreciated.

    I have chosen not to use iCloud for the time being since the syncing was inconsistently working with the calender and contacts;  and cannot get the Reminders on my Mac to sync/replicate onto my ios device, neither iphone nor ipad.  Help is appreciated in respect to Reminders.  Thank you.

    ok, thanks.  couple other questions...
    1. will it sync to my reminders on my MAC too if i enter via icloud?  if not, what's the reason for  having the reminder list available on my Mac if it can't sync? 
    2. I have 2 different email accounts, one with a .mac address and another with .msn.  both can be accessed via icloud.  i ran a test using my msn acct as the signin and it logged the reminder onto both the iphone and ipad fine.
    however, when i try with my mac address, it only shows up on my iphone, which list reminders under icloud(which worked on both devices and then under mac which worked only on the iphone, not ipad.  any idea why that might be happening?
    thanks for your help.

  • How can i use AME for the new OAF page.

    Dear all,
    I have developed a new OAF page and registered under Employee Self Service.
    How can i use AME for the approval process.
    Appreciate your ideas?
    zamora

    I will try to answer based on my experience of working with iProcurement and AME. It depends on how you want to make a call to AME , directly from OAF Page or from Workflow and your requirement. You didn't specify what you want to show the users on OAF Page and your business requirement.
    Before calling AME Engine from the OAF page or workflow, I guess you did already setup AME Transaction Type and it's Approval Groups, Conditions, Action Types and Rules. Do some testing from AME Business Analyst Test Workbench. Please note that, AME provides lot of PL/SQL API's that you have to call from your programs (java or workflow pl/sql)
    Let's look at the workflow and putting an OAF Page as notification.
    As Sameer said, you have kick-off workflow process from PR of CO and with in the workflow function, you make a call to AME Engine API's with the AME Transaction ID. This transactionId belongs to the AME Transsaction Type that you setup. Based on the rules setup, AME Engine generates list of approvers/approver and stores them AME Tables for that transactionId. Then, it sends a notification to the approver.
    In the workflow, where that notification is defined, in the message body you have to put an attribute(&XX_WF_FWK_RN) of type document/send. And this attribute will have the constant JSP:/OA_HTML/OA.jsp?OAFunc=XX_FUNC&paramId=-&DOCUMENT_ID-. This function is SSWA Jsp function that makes a web html call to your OAF Region.
    If your requirement is to just show the list of approvers on the OAF Page, you may have to call AME API diectly passing your AME TrasnactionId with other parameters. Then AME generates list of approvers and stores them in AME tables with each approver status. You can pickup those approvers using VO and show them on OAF Page.
    Hope this gives some idea.

  • I have bought an iPhone4 and to be able to use it for the first time I connected into a friends itunes. Now when I want to buy itunes stuff on the phone it asks me her password. How can I set up again my itunes account?

    I have bought an iPhone4 and to be able to use it for the first time I connected into a friends' itunes. Now when I want to buy itunes stuff on the phone it asks me her password. How can I set up again my itunes account?
    Now I also have a macbook where I can sync my iphone but it doesn't allow me

    first of all only sync it with 1 computers itune account
    second settings->general->store click the appleID box with her appleID in it and log out

  • I have an old (first generation) iMac that I still use sometimes for the applications that are on it. I was using it yesterday and unfortunately had a power cut. I went to turn it on today, and nothing at all happens. It's as though no power is getting to

    I have an old (first generation) iMac that I still use sometimes for the applications that are on it. I was using it yesterday and unfortunately had a power cut. I went to turn it on today, and nothing at all happens. It's as though no power is getting to it. I've checked the obvious things, changed the fuse, tried different cables, poked paperclips in reset holes, but nothing doing. I wonder if there is anyone who knows what might be wrong. I was hoping to get some of its content transferred soon, but I'm guessing that can't be done if it can't be started up. Many thanks, if you can help

    Hello,
    >It's as though no power is getting to it.
    Would it be correct to assume that no sounds at all can be heard? Also, no lights, not even green or amber at the power button?
    >unfortunately had a power cut.
    Was it possibly a power cut in connection with a thunderstorm? Any other evidence of higher than normal voltages (light bulbs, et cetera)? Has the line voltage been checked (measured with an appropriate voltmeter/multimeter)?
    If necessary, it would be possible to remove the hard drive, and then connect it to an external IDE/ATA to USB adapter (example below). That way you could gain access to files on the hard disk from another computer.
    http://www.newertech.com/products/usb3_universaldriveadap.php
    Jan

  • How stop PS6 from removing the DPI value from an image when using "save for the web"?

    How stop PS6 from removing the DPI-value from an image when using "save for the web"?
    Example:
    - Open a tif image, that contains a dpi value (resolution).
    - Use the splice tool in PS6.
    - Export the slices with "Save for web", as gif-files.
    Then the dpi value is removed, the gif files has no dpi value (it's empty).
    How can we stop PS6 from removing the dpi value when using "save for web"?
    OR:
    When using the slice tool, how can we save the sliced pieces without PS removing the dpi value?

    you can make your art go a little bit over the bounds. or you can make sure your artboart and art edges align to pixels

  • Using dbms_job for the 1st time

    I am attempting to use dbms_job for the 1st time and doing some test, but I can't get it to run.
    Connected to: Oracle Database 10g Release 10.1.0.2.0 - Production
    SQL*Plus: Release 8.0.6.0.0 - Production on Wed Mar 1 10:36:18 2006
    I have alter system set job_queue_interval = 10;
    When I tried
    SQL> alter system set job_queue_interval = 10;
    alter system set job_queue_interval = 10
    ERROR at line 1:
    ORA-25138: JOB_QUEUE_INTERVAL initialization parameter has been made obsolete
    my code is as below.
    1 create or replace procedure d1 is
    2 v_job_no binary_integer;
    3 begin
    4 DBMS_JOB.SUBMIT(
    5 v_job_no,
    6 'test_dbms_job',
    7 trunc(sysdate,'hh')+1/24,
    8 'trunc(sysdate,''hh'')+2/24');
    9 commit;
    10* end;
    SQL> /
    Procedure created.
    SQL> exec d1;
    BEGIN d1; END;
    ERROR at line 1:
    ORA-06550: line 1, column 107:
    PLS-00103: Encountered the symbol "END" when expecting one of the following:
    := . ( @ % ;
    The symbol ";" was substituted for "END" to continue.
    ORA-06512: at "SYS.DBMS_JOB", line 79
    ORA-06512: at "SYS.DBMS_JOB", line 136
    ORA-06512: at "PMC_ERP_PROD.D1", line 4
    ORA-06512: at line 1
    Any clues??

    sorry, when I cut and pasted this I but in
    job_queue_interval in twice.
    I alredy have the following set also.
    SQL> alter system set job_queue_processes = 4;
    System altered.Well, it's good...
    And what about semicolon ? ;-)

  • How to create a new variant and a job sheduled to use it for the ......

    How to create a new variant and a job sheduled to use it for the exisisting programs

    Hi
    1. The ALV Grid Control is a tool with which you can output non-hierarchical lists in a
    standardized format. The list data is displayed as a table on the screen.
    The ALV Grid Control offers a range of interactive standard list functions that users need
    frequently (find, sort, filter, calculate totals and subtotals, print, print preview, send list,
    export list (in different formats), and so on. These functions are implemented in the
    proxy object class. You as the programmer have the possibility to turn off functions not
    needed. In most cases the implementations of the standard functions provided by the
    control are sufficient. However, if required, you can adjust these implementations to
    meet application-specific needs.
    You can add self-defined functions to the toolbar, if necessary.
    The ALV Grid Control allows users to adjust the layout of lists to meet their individual
    requirements (for example, they can swap columns, hide columns, set filters for the
    data to be displayed, calculate totals, and so on). The settings (list customizing) made
    by a specific user are called a display variant. Display variants can be saved on a userspecific
    or on a global basis. If such display variants exist for a list, they can be offered
    to the user for selection. If a display variant is set as the default variant, the associated
    list is always displayed based on the settings of this variant.
    2. REUSE_ALV_LIST_DISPLAY
    REUSE_ALV_GRID_DISPLAY
    REUSE_ALV_FIELDCATALOG_MERGE
    REUSE_ALV_COMMENTARY_WRITE
    3. Use of Field Catalog is to determines the technical properties & add formating information of the column.
    6. all the definition of internal table, structure, constants are declared in a type-pool called SLIS.
    7.fieldcat-fieldname
    fieldcat-ref_fieldname
    fieldcat-tabname
    fieldcat-seltext_m
    5. Form user_command using r_ucomm like sy-ucomm rs_selfield type slis_selfield.
    Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length.
    In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output.
    The report output can contain up to 90 columns in the display with the wide array of display options.
    <b>The commonly used ALV functions used for this purpose are;</b>
    1. REUSE_ALV_VARIANT_DEFAULT_GET
    2. REUSE_ALV_VARIANT_F4
    3. REUSE_ALV_VARIANT_EXISTENCE
    4. REUSE_ALV_EVENTS_GET
    5. REUSE_ALV_COMMENTARY_WRITE
    6. REUSE_ALV_FIELDCATALOG_MERGE
    7. REUSE_ALV_LIST_DISPLAY
    8. REUSE_ALV_GRID_DISPLAY
    9. REUSE_ALV_POPUP_TO_SELECT
    Purpose of the above Functions are differ not all the functions are required in all the ALV Report.
    But either no.7 or No.8 is there in the Program.
    <b>
    How you call this function in your report?</b>
    After completion of all the data fetching from the database and append this data into an Internal Table. say I_ITAB.
    Then use follwing function module.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = 'Prog.name'
    I_STRUCTURE_NAME = 'I_ITAB'
    I_DEFAULT = 'X'
    I_SAVE = 'A'
    TABLES
    T_OUTTAB = I_ITAB.
    IF SY-SUBRC <> 0.
    WRITE: 'SY-SUBRC: ', SY-SUBRC .
    ENDIF.
    ENDFORM. " GET_FINAL_DATA
    The object F_IT_ALV has a field, the activity ACTVT, which can
    contain four permitted values: 01, 02, 03 and 70. Each of the
    activities 01, 02 and 70 controls the availability of particular
    functions (in the menu and the toolbar) of the ALV line item list:
    a) 01: "Settings -> Display variant -> Save..."
    b) 02: "Settings -> Display variant -> Current..." and
    "Settings -> Display variant -> Current header rows "
    c) 70: "Settings -> Display variant -> Administration..."
    Activity 03 corresponds to the minimum authorization, which is the
    most restricted one: The user can only select layouts which have
    been configured already. In particular, all of the other functions
    named above are inactive with activity 03.
    Now if you want to permit a user to change the column selection and
    the headers as well as to save the layout thus created, for example,
    but if you do not want to permit the user to administrate the
    layouts, you grant him or her the authorization for activities 01
    and 02.
    Check this link it will be mosty usefull for u
    http://www.sap-img.com/fu017.htm
    Reward all helpfull answers
    Regards
    Pavan

  • Applications are mentioned free, but when we start downloading one dollar is charged in my credit card, but only for the first time when i switch on and use it for the first time one dollar is charged. and from next application it is free. why?

    Applications are mentioned free, but when we start downloading one dollar is charged in my credit card, but only for the first time when i switch on and use it for the first time one dollar is charged. and from next application it is free. why?

    Kindly inform any email id or toll free number to contact apple for your below answer, Mr.King_Penguin
    About receiving my credit card being debited for Free App Store Application downloads,
    It should be within a few days, but it might vary a bit by bank/provider :
    I am in India, if the bank don't refunds , what to do?
    Rajagopal.pngr :-  It is only a holding charge, it is not a permanent charge. If it isn't refunded within a few days or so (and it quite possibly won't be over a weekend) then you can query the charge with Apple.

  • How can I copy the titles from a project volume one use them for the rest?

    I'm editing a four DVD set, and would like to use the same opening titles and credits for each. How can I copy the titles from volume one and use them for the rest? Thank you.

    Open the project that has the titles you want to use. Select (highlight) all the title clips you want, then right-click and choose COPY.
    Open the new project(s), then paste the titles onto the Timeline.
    Done.
    -DH

  • My iPod has not been working for a month now and i was hoping that you could help me.The part where you charge and sync the iPod is not connecting.There is defiantly not the lead as we use it for the iPhone and that works please could you help!

    my iPod has not been working for a month now and i was hoping that you could help me.The part where you charge and sync the iPod is not connecting.There is defiantly not the lead as we use it for the iPhone and that works please could you help!
    yours sincerly
    jackfromsurrey

    What I am saying is ..........
    The iPhone HAS to be active making calls on the UK carrier network for the carrier to identify as "theirs" and therefore eligible for the Carrier to unlock
    The way to achieve this is to use a PAYG sim making and receiving calls to establish a customer relationship  with the Carrier and then follow the Carrier's process to unlock
    With a PAYG it usually means adding a specified (by the carrier ) amount  usually £15 /£20 depending on the carrier
    This is how O2 function and according to Gemma  this is how Vodafone work

  • Use cases for the SAP HANA Appliance for SAP FI-Accts.Payable

    Hello SAP HANA friends:
    Are there any compelling use cases for the SAP HANA Appliance for SAP FI-AP Accounts Payable module?
    CO-PA and CRM have many immediate use cases, but I'm looking for the use case for Accounts Payable,
    either from a cash flow perspective or performance.
    Any and all comments are appreciated.
    Regards,
    Joe Gonzales
    856 912 1136

    Hi,
    In SQL console please execute below query .
    GRANT SELECT ON SCHEMA <schema Name> TO "_SYS_REPO";
    BR
    Sumeet

  • Reg:  where used list for the any logical (or) physical files

    Hi
    Is there any possible way to check the where used list for the any logical (or) physical files (Tcode: FILE)
    Please let me know.

    if the path is hard coded in the program...
    you can use : RPR_ABAP_SOURCE_SCAN to scan the system and find out where its hard coded....

Maybe you are looking for

  • How can I create a sub-folder within my "Documents" folder?

    How can I create a sub-folder within my "Documents" folder? I have many similar documents that I want to group together. This will also un-clutter my Documents folder.

  • Help with Sort function in Terminal

    Hello all... this is my first post on here as I'm having some trouble with some Termianl commands. I'm trying to learn Terminal at the moment as it is but I would appreciate some help with this one.... I'm trying to sort a rather large txt file into

  • Network Manager get ip but no connection to the internet

    Hi guys, I'm new to Arch, and first of all I must say that I think I'm going to love it :-) Never seen a package manager so fast to install a lot of packages! And it's kinda cool to have everything under control. But here is a problem I don't have un

  • Installation issues from 10.2.8 to 10.4

    I have an imac G4 15 inch flat panel 800mhz. Memory 768 mb. It has a dvd player, cd burner. OS 10.2.8 I'm trying to install Mac OS Tiger DVD. The icon for the disc would come on but when I click on it, it opens then after a few seconds of spinning wh

  • Adding two column data  from two different tables.

    Hi, I have two tables i want to add two column with same id and put it in third table T1 is id Value 1 50 2 100 3 500 4 75 T2 is id Value 3 -20 4 80 5 -30 6 -10 I want the out put as 1 50 2 100 3 480 4 155 5 -30 6 -10 i have written select a.id,a.val