Monday, April 26, 2010

[JSTL] According to TLD or attribute directive in tag file, attribute items does not accept any expressions

The cause:

Version incompatibility between JSP, Servlet and JSTL.

Solution:

You will have to open the web.xml file in WEB-INF folder and check if the DTD version is correct.

Example:

<web-app xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" c="http://java.sun.com/jsp/jstl/core" schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
</web-app>

The version above is 2.5 so you have to change to 2.4 or 2.3.
Matching versions are listed below:

- JSP 1.2 , Servlet 2.3 , JSTL 1.0;
- JSP 2.0 , Servlet 2.4 , JSTL 1.1;

Using the correct Servlet version the error won't be displayed anymore.

Solved!

Sunday, April 25, 2010

The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

The problem happens because you didn't declare the tag libs in your web.xml file.

Follow the steps:

1 - If you are using the newest version of JSTL ( 1.0.6 ) then you can find the tld files at "tld" folder, else you have to extract the standard jar and search into folders;

2 - Put the tld file in WEB-INF folder;

3 - Open web.xml at WEB-INF folder and write the declaration below:

<taglib>
<taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/fmt.tld</taglib-location>
</taglib>

4 - Make sure that you are calling:

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

on top of your JSP page;

5 - Restart your server if it's running and..

Solved!

Saturday, April 24, 2010

How to remove MySQL Server completely from Mac OS X Leopard

The process isn't deductible so you need to know the files and folders that the MySQL installer changes.

To remove completely, make sure MySQL Server is not running and follow the instructions below:

Part 1:

1 - Open Terminal;
2 - sudo nano /etc/hostconfig;
3 - Enter your password;
4 - Delete the following line: “MYSQLCOM=-YES-”;
5 - Control + X ( to close );
6 - Enter Y ( to save );


--

Part 2:

Open Terminal and run the following commands:

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm /etc/my.cnf

Solved!

This solution was found in Tom Keur's Blog.

Wednesday, April 21, 2010

SQL Server 2008 Designer Behavior Change: Saving Changes Not Permitted

Are you having this message when you are trying to change a table Design (columns type, name and etc..)?

It's easy to resolve:

In Microsoft SQL Server Management Studio click on "Tools > Options".
Expand "Designers" and click on "Table and Database Designers".
Uncheck the option "Prevent saving changes that require table re-creation".

Try again,..

and..

Solved!

Constructor method is not setting the attributes - iPhone Development

Are you facing with "out of scope" message when you debug your code and after the class allocation you call the constructor method passing some initialization variables?

I'll show you a wrong and a correct method respectively:

-(void)initWithName:(NSString*)n andNickName(NSString*)n2
{
// this is a wrong method.
self.name = n;
self.nickName = n2;
}

--

-(void)initWithName:(NSString*)n andNickName(NSString*)n2
{
// this is a correct method.
self = [super init];
self.name = n;
self.nickName = n2;
[self retain];
}

If you don't know about "retain and memory management" click here.

Solved.

Resolving sandbox orkut error adding your own application

Are you receiving this orkut message when you are adding your application to sandbox: "This gadget cannot be dispalyed because of users age or safety settings" ?

Resolution:
You have to change the "Security filter" to "Show all contents".

Steps:
1 - Login into your account;
2 - Settings > General > Security Filter and set to: Show all contents.

Solved!!

How to enable remote connection on SQL Server 2008 Express

1 - Start "SQL SERVER BROWSER" service;
2 - Open "Sql Server Configuration Manager" expand "Sql Server Network Configuration" and enable TCP/IP on "Protocols for SQLEXPRESS";

Solved!

Reducing SQL Server Transaction Log Size

What can I do when I receive this message:

The transaction log for database 'xxx' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases in EXEC.

First check if you have no free space in your hard disk.

If you want to reduce your log file you can follow this steps:

1 - Backup the log at SQL Server Management Studio > Object Explorer > Databases > Right click your database > Tasks > Back Up and set "Transaction Log" in Backup Type field;

2 - alter database YourDataBaseName set recovery simple;

3 - dbcc shrinkfile ('YourDataBaseLogName', NewLogSize);
E.g.: dbcc shrinkfile ('StoreDb_log', 1);

4 - alter database YourDataBaseName set recovery full;

Solved!