Showing posts with label Web Sites. Show all posts
Showing posts with label Web Sites. Show all posts

Import CSS and JQuery files in JSP

 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
 <link type="text/css" rel="stylesheet"href="${pageContext.request.contextPath}/css/bootstrap.min.css" />  
 <script type="text/javascript"src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>  
 <title>Concept Extractor</title>  
 <script type="text/javascript">  
  $(document).ready(function() {  
  alert("asdf");  
  });  
 </script>  

Is it possible to get HTML of an iframe - CAN'T

You are trying to access content of iframe which points to webpage from another domain. You cannot access content of iframe if the src of that iframe is not pointing to the domain on which your current parent page is. This is called cross domain policy

You will have to use server side language that will grab the html of given url and return it to your index page to display in any div or whatever.

Let me give you an example to explain why javascript cannot have cross domain access.
  • Suppose i have FB like box on my website inside an iframe
  • now whenever any user comes on my website i will trigger a click to the like box which is inside the iframe of like box.
  • This way my FB page will have lakhs of likes.
  • But because of cross domain policy this cannot be done.

Deployment of Apache Tomcat 7 in Amazon server


 Before Installation Check your java Jdk installed or not.  
 Step 1:  
 Download the Apache tomcat 7 from the bellow link,  
 Step2:  
 md5sum apache-tomcat-[#].tar.gz  
 Next, extract the package:  
 tar xvzf apache-tomcat-[#].tar.gz  
 And move the extracted folder into a dedicated directory:  
 sudo mv apache-tomcat-[#] /usr/local/apache  
 Step3: Set the path   
 vi ~/.bashrc  
 export CATALINA_HOME=/usr/local/apache  
 Log out and log back into bash to have your changes take effect.  
 Step4: Start tomcat  
 sudo /usr/local/apache/bin/startup.sh  
 Step 5 : Check  
 Go to web browser and type ,  
 http://localhost:8080  

Deployment of Glassfish In amazon server

GlassFish is an open-source application server project started by Sun Microsystems for the Java EE platform and now sponsored by Oracle Corporation. The supported version is called Oracle GlassFish Server. GlassFish is free software, dual-licensed under two free software licences: the Common Development and Distribution License (CDDL) and the GNU General Public License (GPL) with the classpath exception.

GlassFish is the reference implementation of Java EE and as such supports Enterprise JavaBeans, JPA, JavaServer Faces, JMS, RMI, JavaServer Pages, servlets, etc. This allows developers to create enterprise applications that are portable and scalable, and that integrate with legacy technologies. Optional components can also be installed for additional services.




 Step 1:   
 Connect the Amazon server through terminal using DNS and the KEY.  
 To connect with amazon server:  
 ssh -i <key_path> <username>@<ip_adress_server>  
 First of all we need to check the java dependencies.  
 sudo apt-get update  
 sudo apt-get remove openjdk-6-jre-headless  
 sudo apt-get install sun-java6-jdk sun-java6-jre sun-java6-javadb  
 sudo apt-get autoremove  
 Step 2:  
 go to terminal in Ubuntu  
 go to your home directory in terminal   
 enter wget http://download.java.net/glassfish/4.0/release/glassfish-4.0.zip to download the glassfish in to your server.  
 Step 3:  
 Configure and change default port for Glassfish if tomcat already use port 8080.Because usually it use the port 4848.If you need as default please avoid thid Step 3.  
 vim glassfishv3/glassfish/domains/domain1/config/domain.xml  
 <network-listeners>  
 <network-listener port="8081" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool" />  
 <network-listener port="8181" protocol="http-listener-2" transport="tcp" name="http-listener-2" thread-pool="http-thread-pool" />  
 <network-listener port="4848" protocol="admin-listener" transport="tcp" name="admin-listener" thread-pool="http-thread-pool" />  
 </network-listeners>  
 Step 4:  
 Running by Glassfish  
 ./glassfishv3/glassfish/bin/asadmin start-domain --verbose  
 Step5:  
 Go to your-domain:8081 to see web page and your-domain:4848 for administrator pages  
 Glassfish Controls :  
 Create domain  
 Start and Stop Domain  
 Delete Domain  
 Enable secure Admin  

 Error may occur:  
 Solution:  
 http://charleech.wordpress.com/2012/03/23/glassfish-version-3-1-2-secure-admin-must-be-enabled-to-access-the-das-remotely/  
 http://coders-kitchen.com/tag/secure-admin-must-be-enabled-to-access-the-das-remotely/  

Setting Up Blogger Crawler and Index

Now Blogger has great feature for search engine visibility.Now we can visible our blog in search engines with robot.txt. To active this feature go to Settings | Search Preferences, click Edit next to "Custom robots.txt" and select Yes. After this selection text box will be visible to give the crawler code for your site.

Note: which was mention in blogger site
Warning! Use with caution. Incorrect use of these features can result in your blog being ignored by search engines.

by default the robot.txt has following code,
User-agent: Mediapartners-Google
Disallow: 

User-agent: *
Disallow: /search
Allow: /
Sitemap: http://www.example.com/feeds/posts/default?orderby=updated

User-agent: Mediapartners-Google is a robot from Google Adsense, leave it as is because if you mistakenly change that than the ads served will not fit with your content.

The next line is for all the robots and marked with an asterisk (*). On the default configuration, it is clear that the label of our blog is not indexed Disallow: /search.

Keep in mind that a slash (/) is as your homepage, so for example if you want the label to get indexed, do not just fill up with a slash like this Disallow: / because that would be you do not allow the robot tracing your blog

Finally your code can be like bellow,
User-agent: Mediapartners-Google 
Disallow:
User-agent: * 
Disallow: /search?updated-min= 
Disallow: /search?updated-max= 
Disallow: /search/label/*?updated-min= 
Disallow: /search/label/*?updated-max= 
Allow: / 
Sitemap: http://www.youtdomain.blogspot.com/feeds/posts/default?orderby=updated

After the changes, make sure everything is fit like what we want by visiting www.example.com/robots.txt. Replace the Example.com with your domain name.