Dynamic code [i]replacement[/i]
Hi all,
I have seen dynamic code replacement used in Tomcat, Eclipse, jEdit, ... but whenever I go to research how to incorporate it into my applications, I just get a bunch of stuff about Erlang, python, and Java ClassLoaders, which if a class is already loaded don't bother reloading it.
So does anyone know how I can use "Dynamic Code Replacement" not "Dynamic Code Loading"? (I'm doing stuff with Java WebServer Containers)
IT works a little something like this.
If you create a classlaoder to load your "replaceable" classes and ensure that your replaceable classes are not in the classpath (or that your classlaoder does not delegate to its parent bit dangerous security wise)). Then your classloader will load your replaceable classes (It will delegate to its parent but its parent will not find them). Then to reload your classes all you have to do is drop all references to your classloader and create a new classloader. It can then load your "repaced" classes.
Acutally its not quite that simple. If any live references exist to any classes loaded by your classloader then your classloader will not go "out of scope" as those classes will reference the classloader.
To do it properly takes good design. Take a look at the link RadcliffePike posted for one (pretty complicated) desgin. I believe that tomcat uses trees of classloaders to allow all the weapps to "live" independently of each other while allowing them to use the classes that are in the common/lib directory (shared jar files)
matfud
Similar Messages
-
Create dynamic code on a JSF with ADF Faces
Hi,
the next is just sample, nothing to production system, but if I can do the sample I can do something to production system.
Fine.
let's suppose that I want to create a html link
in run-time over a JSF page with ADF Faces component.
I can do that, I did using javascript and Custom tag,
but the html link is placed out of the body of the page instead of put it over the place that I put it in development-time
so, now my question is:
how I can generate dynamic code using ADF FACES component commandButton or any others.
any suggestion??
P.D. if you need more info ask me.Hello Jeanne.
You are right, I used <f:verbatim> element to wrap all my non-JSF elements and it work. :)
so good so far.
but, dynamic code mean generate code in this case HTML in run-time.
That is to say: write code HTML just in time I invoke a page.
That is posible through Custom Tags.
You create a Custom Tags this tag generate HTML code after to process any Business Logic. then you put the tag in the page that you want to use it
someting like this:
<afh:rowLayout halign="center">
<afh:cellFormat halign="center">
<ESE-utilities:populateMenu/>
</afh:cellFormat>
</afh:rowLayout>
the just above bold line is my Custom Tag that generate HTML code
and not work.
but, if I replace the tag directly using HTML code in the page, for example:
<afh:rowLayout halign="center">
<afh:cellFormat halign="center">
<f:verbatim>
prueba
</f:verbatim>
</afh:cellFormat>
</afh:rowLayout>
it work
so, now my new question is:
¿How can I use a Custom Tagthat generate HTML code, and that code have been written inside of my body page?
Thanks in advantage for your reply.
Mauricio -
Writing Dynamic code in smart form
Hi All,
I have a issue on Smart form . the smart form is customized view of bbp_po(srm) for po(purchase order) details in that in a secoundary window where vedor adress is displaying .In the first line of the address name1 and name2 are displaying now my need is if the name1+name2 is more than 47 chars then i need to shift name2 to next line how can i do this dynamic code plase i need it urgently .
Thanks
channu sajjanarHi
Write code yto count the no of character, if it is more than 47 then display NAME2 in second line else write in first line.
for second line put conditionin text element NAME2 <> space.
This will work
Thanks
Shiva -
How to write the dynamic code for RadioGroupByKey and Check Boxes?
Hi,
Experts,
I have created a WD ABAP application in that i have used RadioGroupByKey and CheckBox Ui elements but i want how to write the dynamic code to that i want to display male and female to RadioGroupByKey and 10 lables to check boxs.
Please pass me some idea on it and send any documents on it .
Thanks in advance ,
Shabeer ahmed.Refer this for check box:
Do check :
bind_checked property is bind to a node with cardinality of 1:1
CHECK_BOX_NODE <---node name
-CHECK_BOX_VALUE <--attribute name of type wdy_boolean
put this code under your WDDOMODIFYVIEW:
DATA:
lr_container TYPE REF TO cl_wd_uielement_container,
lr_checkbox TYPE REF TO cl_wd_checkbox.
get a pointer to the RootUIElementContainer
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_checkbox = cl_wd_checkbox=>new_checkbox(
text = 'WD_Processor'
bind_checked = 'CHECK_BOX_NODE.CHECK_BOX_VALUE'
view = view ).
cl_wd_matrix_data=>new_matrix_data( element = lr_checkbox ).
lr_container->add_child( lr_checkbox ).
Refer this for Radiobutton :
dynamic radio button in web dynpro abao
Edited by: Saurav Mago on Jul 17, 2009 10:43 PM -
Servlet with no dynamic code inside jsp pages
Hello,
I saw that a servlet is created even if there is no dynamic code inside jsp pages (scriplets & tags). Is it possible to avoid it on bea side ? (I am using portal 8).
By the way, do you know if is it possible to define apache in order to avoid to send to bea the jsp which have no dynamic code inside ?
thank you !JSP's always generate a servlet on all web containers. Apache/Tomcat is no
different. If you have static content, make it an HTML page.
Bill
"hournon jc" <[email protected]> wrote in message
news:22255787.1103297053148.JavaMail.root@jserv5...
> Hello,
>
> I saw that a servlet is created even if there is no dynamic code inside
jsp pages (scriplets & tags). Is it possible to avoid it on bea side ? (I am
using portal 8).
>
> By the way, do you know if is it possible to define apache in order to
avoid to send to bea the jsp which have no dynamic code inside ?
>
> thank you !
-
'Unallowed tags or dynamic code' error on a page without these...
Hi,
I've been using InContext Editing for a few sites now and my clients have been very happy with it, but I have a new site that's having problems on just one page.
http://www.windhampilates.com/index.php
I've enabled ICE on the text areas below the main photo and nav bar, as I have on other pages. There are a few scripts running on this page, but the only difference on this page from the rest of the site is the rotating image at the top of the page.
Ironically, I've used this same script on previous sites where I've used ICE and they've worked without any problems. Am I missing something?
Really and truly appreciate your help!
- MaryAnnI can login, and try to edit, but the system won't save my changes and gives me the 'unallowed tags or dynamic code' error as the reason why it can't save the changes.
I tried removing the jquery in the header, but that didn't seem to work:
http://www.windhampilates.com/index-testjqueryerror.php
I still can't get the edits to save and it's still giving me the same message.
The only other non-static elements on the page are the newsletter subscription script and the Facebook link, but I have these on other pages and we can edit those pages without issue.
Any other ideas?
Thanks for your help! -
Running Dynamic Code - Is it possible?
Hi guys,
I am interested to know whether there is a way I can run dynamic code in my java program. For example, I want to be able to write java code into a JTextArea and then run that code as like an extension of the program.
In other words, if I wrote something simple like "System.out.println("Hi");, it would print the work "Hi" in the console as if it were part of the original program.
Does anyone know if there is a way to do this? Alternatively, is there a way I can call the Javac tool from within a program, thus allowing me to dynamically compile a program.
Thanks guys,
WATTO
[email protected]
http://www.watto.orgI think JSP is a variant of such a frame. You can
execute a code compiling it.JSP is normally compiled into bytecode when it is first loaded by the container.
beanshell and [url http://www-124.ibm.com/developerworks/projects/bsf]BSF are, I think what the poster is after, on this very frequently asked question :) -
Private meetings (dynamic codes) AND no lobby for PSTN callers?
Hi All,
Is there any way to have private meetings (therefore with dynamic entry codes) AND have PSTN callers bypass the lobby?
I understand that the option PSTNCallersByPassLobby does not take effect if you are configured for private meetings? In our scenario, we want private meetings to avoid potential issues with public meetings/static codes and over-running meetings
etc., but we often have people joining meetings from a cell phone only and we do not to burden users with a PIN.
I know we have the option to use public meetings/static codes by default and train users to set a dynamic code if the meeting requires it, but this again relies on user behavior.
Any way we can have the effect of private meetings/dynamic codes AND PSTN Callers bypassing Lobby by default?
CheersSamuel,
If you are talking about generating a separate meeting space for each meeting and having PSTN users bypass the lobby then yes - you can do that. In outlook I have set my Lync meeting options to do just that - create each Lync meeting in a new
space so each one is unique and back to back meetings don't let everyone join in to the same meeting. I also have it set to allow PSTN users to bypass the lobby. It works fine.
Craig -
163;
There seems to be an issue with the template that the site is using as there is a code to replace the pricing.
<script>
// Script to extract the currency and decimals from the price
var price = "{tag_saleprice}";
var priceWithoutCurrency = price.replace( /^\D+/g, '')
var decimals = priceWithoutCurrency.substring(priceWithoutCurrency.length - 2, priceWithoutCurrency.length);
var roundedPrice = priceWithoutCurrency.substring(0, priceWithoutCurrency.length - 3);
$('.image-with-price.big span').html(roundedPrice+'<sup>'+decimals+'</sup>');Here are the screenshots for what it's worth.
Not sure why I can't post them in the original post.<br>
<sub><b>Mod edit: See [https://bugzilla.mozilla.org/show_bug.cgi?id=718813 bug 718813]</b></sub>
'''Again, when I set my DNS server to automatically detect the servers both problems disappear and I have no issues at all.'''
IMO opendns is either doing this on purpose (unlikely) or they're under some sort of attack/being used to attack the specific torrent sites although I'm open to other explanations. I believe using the automatic setting for DNS is using my own ISP's DNS servers (which again, work fine... but still...)
I'd rather not use Google's public DNS servers as Google is to commercial these days and I think there's potential privacy issues.
'''Again I have changed the setting for DNS servers back and forth several times to duplicate/verify the issue(s)... and the issues only happen with the opendns servers.''' -
Hi,
I'm havinging these
p_rt in out pkg_my.rec_set) is
begin
open p_rt for v_sql||v_sql2
using v_seq, to_date(v_date,'yyyymmddhh24misssss'), v_my_NAME;
and have got this
PLS-00455: cursor 'P_RT' cannot be used in dynamic SQL OPEN statement
how to make it fine?
Regards,
huaminAs already explained, you need to give us more detail.
Why are you wanting to returns a record set, rather than just return a ref cursor (sys_refcursor)?
e.g. The following function returns a ref cursor to the calling code (in my case the calling code is SQL*Plus)...
SQL> ed
Wrote file afiedt.buf
1 create or replace function get_dept(p_deptno in number) return sys_refcursor is
2 v_rc sys_refcursor;
3 begin
4 open v_rc for 'select * from emp where deptno = :1' using p_deptno;
5 return v_rc;
6* end;
SQL> /
Function created.
SQL> var x refcursor;
SQL> exec :x := get_dept(20);
PL/SQL procedure successfully completed.
SQL> print x;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17/12/1980 00:00:00 800 20
7566 JONES MANAGER 7839 02/04/1981 00:00:00 2975 20
7788 SCOTT ANALYST 7566 19/04/1987 00:00:00 3000 20
7876 ADAMS CLERK 7788 23/05/1987 00:00:00 1100 20
7902 FORD ANALYST 7566 03/12/1981 00:00:00 3000 20
SQL>It is SQL*Plus that get's the ref cursor back and then does the fetch on that cursor to retrieve the records and display them using it's "print" command.
In another language, it would get the ref cursor and then process the rows by fetching them as appropriate for that language.
You don't need the function/procedure to fetch all the data into some sort of type structure and try and pass it all back. -
XSLT mapping code to replace ns1: tag as plm: in XML file in PI mapping
Hi
I am sending XML file to HTTP server as below format
<?xml version="1.0" encoding="UTF-8" ?>
- <ns1:Responses xmlns:ns1="http://">
- <ns1:Response Application="SAP">
<ns1:field1>12345</ns1:field1>
<ns1:field2>abc</ns1:field2>
- <ns1:Items>
<ns1:doc></ns1:doc>
</ns1:Items>
</ns1:Response>
</ns1:Responses>
i hve to replace <ns1: as <plm:, i could able to delete <ns1: tag uisng XSLT mapping(in sdn), but i dont know how to add tag with <plm:
Hi XSLT experts/if any has come across this requirment, please send XSLT code to add tag in XML.
Regards,
RajeshNo need for XSLT, just use the XMLAnonymizerBean module in your receiver communication channel.
http://help.sap.com/saphelp_nw70/helpdata/EN/45/d169186a29570ae10000000a114a6b/frameset.htm
/people/stefan.grube/blog/2007/02/02/remove-namespace-prefix-or-change-xml-encoding-with-the-xmlanonymizerbean
If your receiver CC cannot process modules (ABAP receiver, for example), in your XSLT just define the target namespace with the desired prefix.
Regards,
Henrique. -
Display byte array image or ole object in Section through dynamic code?
To Start I am a Complete Newbe to Crystal Reports. I have taken over a project originally written in VS2003 asp.net using SQL Server 2005 and older version of Crytal Reports. I have moved project to VS2010 and Cryatal Reports 10 still using SQL Server 2005. Have multiple reports (14 to be exact) that display data currently being pulled from database suing a dataset, each report has from 4 to 14 Sections. I have modified database table with two new fields. Field1 contains string data with full path to a scanned document (pdf or jpeg). Field2 holds a byte array of the actual image of the scanned document. I have tested the database and it does infact contain the byte array and can display the image via VB.net code. I can make the report display the scanned image using ole object.
Now my real question: I need to add a new Section and it should display either the byte array of the scanned image or the actual scanned image (pdf or jpeg) . How can I have it do either of these options via code dynamicly while application is running?First; only CRVS2010 is supported on VS2010. You can download CRVS2010 from here;
SAP Crystal Reports, developer version for Microsoft Visual Studio: Updates & Runtime Downloads
Developer Help files are here:
Report Application Server .NET API Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/xi4_rassdk_net_api_en.zip
Report Application Server .NET SDK Developer Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/xi4_rassdk_net_dg_en.zip
SAP Crystal Reports .NET API Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_api_2010_en.zip
SAP Crystal Reports .NET SDK Developer Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_dg_2010_en.zip
To add the images, you have a number of options re. how to. You even have two SDKs that y ou can use (RAS and CR).
Perhaps the best place to start is with KB [1296803 - How to add an image to a report using the Crystal Reports .NET InProc RAS SDK|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233393336333833303333%7D.do]. The KB describes how to add images to a report using the InProc RAS SDK, but also references other KBs that use CR SDK.
Also, don't forget to use the search box in the top right corner of this web page.
Ludek
Follow us on Twitter http://twitter.com/SAPCRNetSup
Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports] -
Need help with dynamic code generation
Hi Folks,
I am trying to dynamically create and execute the following query
Environment: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
DECLARE
A NUMBER;
stmt VARCHAR2(200);
4
5 CURSOR C1 IS
6 SELECT TABLE_NAME
7 FROM DB_MGMT.CTRL_TAB_RETENTION
8 WHERE RETENTION_PERIOD_IN_MONTHS = 11
9 AND rownum < 2;
10
11 BEGIN
12 FOR i IN C1
13 LOOP
14
15 -- dbms_output.put_line('Table Name: ' || i.TABLE_NAME);
16
17 -- dbms_output.put_line('SELECT min(DT_SKEY), max(DT_SKEY) FROM '||i.TABLE_NAME||' ;');
18
19 stmt :='SELECT min(DT_SKEY), max(DT_SKEY) FROM DWH_RSRC_PERF.'||i.TABLE_NAME||';';
20
21 dbms_output.put_line(stmt);
22
23 execute immediate stmt;
24 END LOOP;
25 END;
26 /I get the following error message
SQL> @sanity_check
SELECT min(DT_SKEY), max(DT_SKEY) FROM DWH_RSRC_PERF.FACT_NOK_CELL_SERVICE2_HH;
DECLARE
ERROR at line 1:
ORA-00911: invalid character
ORA-06512: at line 23Can anybody spot any obvious syntax errors in the above code?
Thanks in advance
rogers42rogers42 wrote:
Hi,
Thanks for the suggestion.
While getting rid of the ";" helps, but the output of the select statement is not displayed?When you do a SELECT statement in PL/SQL, you have to select the results into variables or arrays.
Try something like this:
DECLARE
CURSOR C1 IS
SELECT TABLE_NAME
FROM DB_MGMT.CTRL_TAB_RETENTION
WHERE RETENTION_PERIOD_IN_MONTHS = 11
AND rownum < 2;
min_dt_skey NUMBER;
max_dt_skey NUMBER;
stmt VARCHAR2 (100);
BEGIN
FOR i IN C1
LOOP
-- dbms_output.put_line('Table Name: ' || i.TABLE_NAME);
stmt :='SELECT min(DT_SKEY), max(DT_SKEY) FROM DWH_RSRC_PERF.' || i.TABLE_NAME;
dbms_output.put_line(stmt);
EXECUTE IMMEDIATE stmt
INTO min_dt_skey, max_dt_skey;
dbms_output.put_line ( min_dt_skey || ' = MIN (dt_skey), '
|| max_dt_skey || ' = MAX (dt_skey) for table '
|| i.table_name
END LOOP;
END; -
Dynamic code generation by system in place of Z program when listcube
Hi Experts,
in process chain there is one step attached ABAP program with variant to create a file from 3 cubes and sent it to some other server. one day it was not created any file and did not send to the respective server.
then i opened the process chain in display mode and opened ABAP program in display mode, by double clicking on one cube i was tried to get the data but the program was changed dynamically in place of original customized program. the report name was 'RSDQ_VIEW_REPORT'.
please let me know how it was changed the code dynamically?.Hi Experts,
in process chain there is one step attached ABAP program with variant to create a file from 3 cubes and sent it to some other server. one day it was not created any file and did not send to the respective server.
then i opened the process chain in display mode and opened ABAP program in display mode, by double clicking on one cube i was tried to get the data but the program was changed dynamically in place of original customized program. the report name was 'RSDQ_VIEW_REPORT'.
please let me know how it was changed the code dynamically?. -
Abap code to replace the bank values of Date Field with 20990101
Please correct my abap code I am just trying to replace the bank values of Dataefield to 20990101 but i am getting the error invalid dataformat '00000000 '. Please correct my IF statement so that I can get this resolved
IF SOURCE_FIELDS-DATETO = '00000000 '
RESULT = '20990101'.
ENDIF.
Thanks'
SoniyaHi Soniya,
You can use one of the following:
IF SOURCE_FIELDS-DATETO = ' '.
RESULT = '20990101'.
ENDIF.
or
IF SOURCE_FIELDS-DATETO IS INITIAL.
RESULT = '20990101'.
ENDIF.
or
IF SOURCE_FIELDS-DATETO = '00000000'.
" THERE WAS A SPACE IN YOUR CODE.
RESULT = '20990101'.
ENDIF.
Regards,
Satya
Maybe you are looking for
-
Variable Selection Screen Options.....is this poss??
Variable values can be displayed in Text, Text & Key, Key using the Hammer icon feature. How do I make say only " Text " ( for variables ) as default for all the users ? Message was edited by: Jr Roberto Message was edited by: Jr Robe
-
I've noticed a stutter or jitter in the movies on DVDs I've created using iDVD 08. The effect is as if some frames had been periodically dropped throughout the entire movie. The problem does not exist in the original iMovie 08 video or the video view
-
Clicking Drill Down Plus Sympol its taking more time
Hi , In my drill-down report having 2000 records while initially it takes 25 seconds to render the report after that when i click Plus symbol it takes again 20 secs to display the data.My question is in drill-down report for loading data it will hit
-
Why is radio not showing on iTunes update (and it is ticked in preferences)?
I upgraded to iTunes 11. Regret. Radio does not show. I checked Preferences and it's ticked. ALSO the update eliminated all my podcasts apparently. Can i get them back? What is the point of this update?
-
Our school is having problems with Java.
Our school is having problems with Java. We cannot open our gradebooks which require jnlp or java to open. They worked until January 31 and then quit. I uploaded the Java from oracle but it doesn't open anything it just keeps running. Any ideas?