{"id":131,"date":"2008-09-26T14:34:18","date_gmt":"2008-09-26T19:34:18","guid":{"rendered":"http:\/\/stein.everybody.org\/brain\/?p=131"},"modified":"2011-11-22T10:27:50","modified_gmt":"2011-11-22T15:27:50","slug":"adventnet-netflow-portlet","status":"publish","type":"post","link":"https:\/\/jeremystein.com\/brain\/adventnet-netflow-portlet\/","title":{"rendered":"AdventNet Netflow Portlet"},"content":{"rendered":"<p>In order to use AdventNet Netflow as a portlet, I had to make the following changes:<\/p>\n<ul>\n<li>Copied the JDK to the server and updated the JAVA_HOME in run.bat to use it.  This is required to compile JSPs.  (run.bat already had a reference to tools.jar which only exists in the JDK.  They AdventNet forgot to remove the reference when the crippled their JBoss installation).<\/li>\n<li>Copied ant 1.6 to the server (F:\\apache-ant-1.6.5) and updated the JBOSS_CLASSPATH in run.bat to use it.  This is required to compile JSPs in JBoss.<\/li>\n<li>Modified NetFlow\\applications\\extracted\\NetFlowAnalyzer.eear\\NetFlowAnalyzer.ear\\NetFlowClient.war\\Login.jsp to support passing in the username and password.  Also added a p3p header to allow cookies to work within an iframe.<\/li>\n<li>Added NetFlow\\applications\\extracted\\NetFlowAnalyzer.eear\\NetFlowAnalyzer.ear\\NetFlowClient.war\\autologin.jsp to accept the username\/password and submit them as a post to index.jsp.<\/li>\n<li>Modified NetFlow\\applications\\extracted\\NetFlowAnalyzer.eear\\NetFlowAnalyzer.ear\\NetFlowClient.war\\WEB-INF\\classes\\org\\apache\\jsp\\jspui\\index_jsp.class with a&#8230; ahem, hex editor.  AdventNet didn\u00e2\u20ac\u2122t want anyone editing their JSPs, so they bypassed the normal auto-compilation provided by JBoss.  Fortunately, I just had to modify some strings, which are fairly straightforward to change in a .class file.  I found every reference to \u00e2\u20ac\u0153_parent\u00e2\u20ac\u009d (there were three of them) and I changed the preceeding \u00e2\u20ac\u0153target=\u00e2\u20ac\u009d to \u00e2\u20ac\u0153targeX=\u00e2\u20ac\u009d.  This will cause the web browser to ignore the unrecognized attribute and the links will stop breaking out of the iframe.  As far as I can tell, there was no need for the target attribute.  Maybe there used to be in an earlier version.<\/li>\n<\/ul>\n<p><strong>Update:<\/strong>  Instead of a hex editor, I switched to using a <a href=\"http:\/\/stackoverflow.com\/questions\/5009650\/where-can-i-find-a-java-servlet-filter-that-applies-regex-to-the-output\/5317234#5317234\">regex servlet filter<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In order to use AdventNet Netflow as a portlet, I had to make the following changes: Copied the JDK to the server and updated the JAVA_HOME in run.bat to use it. This is required to compile JSPs. (run.bat already had a reference to tools.jar which only exists in the JDK. They AdventNet forgot to remove [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"class_list":["post-131","post","type-post","status-publish","format-standard","hentry","category-html"],"_links":{"self":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts\/131","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/comments?post=131"}],"version-history":[{"count":0,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts\/131\/revisions"}],"wp:attachment":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/media?parent=131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/categories?post=131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/tags?post=131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}